From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0395.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0395.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0395.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0395.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0395.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0395.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0395.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0395.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0395.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0395.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0395.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0395.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0395.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0395.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0395.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0395.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0395.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0395.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0395.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0395.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0396.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0396.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0396.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0396.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0396.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0396.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0396.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0396.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0396.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0396.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0396.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0396.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0396.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0396.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0396.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0396.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0396.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0396.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0396.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0396.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0397.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0397.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0397.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0397.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0397.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0397.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0397.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0397.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0397.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0397.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0397.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0397.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0397.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0397.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0397.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0397.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0397.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0397.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0397.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0397.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0398.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0398.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0398.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0398.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0398.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0398.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0398.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0398.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0398.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0398.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0398.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0398.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0398.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0398.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0398.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0398.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0398.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0398.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0398.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0398.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0399.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0399.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0399.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0399.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0399.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0399.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0399.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0399.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0399.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0399.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0399.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0399.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0399.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0399.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0399.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0399.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0399.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0399.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0399.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0399.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0400.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0400.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0400.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0400.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0400.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0400.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0400.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0400.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0400.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0400.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0400.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0400.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0400.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0400.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0400.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0400.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0400.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0400.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0400.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0400.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0401.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0401.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0401.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0401.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0401.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0401.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0401.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0401.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0401.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0401.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0401.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0401.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0401.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0401.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0401.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0401.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0401.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0401.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0401.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0401.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0402.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0402.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0402.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0402.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0402.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0402.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0402.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0402.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0402.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0402.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0402.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0402.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0402.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0402.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0402.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0402.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0402.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0402.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0402.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0402.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0403.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0403.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0403.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0403.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0403.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0403.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0403.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0403.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0403.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0403.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0403.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0403.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0403.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0403.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0403.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0403.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0403.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0403.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0403.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0403.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0404.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0404.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0404.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0404.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0404.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0404.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0404.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0404.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0404.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0404.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0404.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0404.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0404.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0404.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0404.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0404.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0404.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0404.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0404.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0404.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0001.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0001.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0001.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0001.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0001.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0001.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0001.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0001.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0001.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0001.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0001.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0001.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0001.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0001.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0001.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0001.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0001.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0001.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0001.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0002.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0002.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0002.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0002.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0002.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0002.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0002.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0002.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0002.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0002.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0002.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0002.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0002.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0002.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0002.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0002.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0002.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0002.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0002.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0003.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0003.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0003.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0003.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0003.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0003.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0003.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0003.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0003.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0003.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0003.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0003.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0003.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0003.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0003.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0003.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0003.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0003.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0003.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0004.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0004.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0004.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0004.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0004.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0004.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0004.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0004.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0004.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0004.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0004.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0004.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0004.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0004.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0004.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0004.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0004.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0004.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0004.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0005.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0005.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0006.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0005.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0005.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0005.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0005.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0005.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0005.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0005.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0005.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0005.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0005.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0005.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0005.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0005.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0005.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0005.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0005.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0005.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0006.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0006.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0007.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0006.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0006.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0006.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0006.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0006.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0006.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0006.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0006.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0006.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0006.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0006.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0006.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0006.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0006.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0006.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0006.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0006.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0007.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0007.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0008.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0007.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0007.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0007.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0007.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0007.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0007.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0007.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0007.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0007.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0007.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0007.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0007.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0007.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0007.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0007.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0007.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0007.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0008.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0008.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0009.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0008.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0008.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0008.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0008.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0008.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0008.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0008.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0008.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0008.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0008.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0008.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0008.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0008.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0008.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0008.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0008.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0008.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0009.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0009.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0010.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0009.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0009.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0009.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0009.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0009.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0009.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0009.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0009.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0009.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0009.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0009.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0009.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0009.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0009.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0009.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0009.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0009.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0010.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0010.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0011.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0010.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0010.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0010.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0010.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0010.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0010.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0010.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0010.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0010.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0010.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0010.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0010.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0010.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0010.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0010.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0010.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0010.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0011.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0001.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0001.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0001.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0001.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0001.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0001.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0001.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0001.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0001.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0001.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0001.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0001.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0001.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0001.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0001.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0001.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0001.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0001.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0001.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0002.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0002.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0002.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0002.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0002.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0002.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0002.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0002.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0002.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0002.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0002.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0002.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0002.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0002.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0002.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0002.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0002.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0002.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0002.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0003.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0003.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0003.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0003.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0003.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0003.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0003.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0003.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0003.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0003.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0003.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0003.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0003.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0003.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0003.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0003.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0003.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0003.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0003.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0004.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0004.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0004.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0004.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0004.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0004.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0004.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0004.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0004.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0004.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0004.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0004.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0004.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0004.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0004.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0004.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0004.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0004.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0004.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0005.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0005.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0006.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0005.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0005.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0005.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0005.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0005.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0005.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0005.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0005.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0005.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0005.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0005.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0005.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0005.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0005.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0005.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0005.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0006.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0006.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0007.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0006.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0006.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0006.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0006.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0006.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0006.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0006.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0006.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0006.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0006.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0006.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0006.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0005.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0006.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0006.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0006.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0006.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0007.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0007.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0008.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0007.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0007.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0007.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0007.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0007.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0007.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0007.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0007.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0007.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0007.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0007.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0007.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0006.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0007.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0007.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0007.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0007.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0008.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0008.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0009.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0008.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0008.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0008.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0008.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0008.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0008.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0008.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0008.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0008.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0008.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0008.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0008.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0007.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0008.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0008.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0008.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0008.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0009.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0009.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0010.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0009.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0009.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0009.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0009.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0009.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0009.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0009.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0009.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0009.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0009.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0009.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0009.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0008.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0009.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0009.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0009.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0009.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0010.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0010.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0011.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0010.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0010.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0010.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0010.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0010.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0010.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0010.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0010.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0010.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0010.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0010.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0010.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0009.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0010.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0010.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0010.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0010.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0001.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0001.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0001.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0001.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0001.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0001.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0001.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0001.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0001.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0001.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0001.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0001.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0001.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0001.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0001.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0002.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0001.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0002.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0001.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0001.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0001.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0002.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0002.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0002.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0002.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0002.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0002.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0002.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0002.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0002.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0002.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0002.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0002.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print out the enumerated ports in a program run in a DOS shell. Make sure your javax.comm.properties file is setup properly and you should see messages saying rxtx and its native library loaded with version information. The INSTALL document covers this in detail and comes with the rxtx 2.0 source. When you know which version of rxtx is being used and what the error is, we can probably figure out what is going on. If the problem is specific to Sun's native implementation, there is little we can do. -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Dec 27 08:53:25 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 27 Dec 2005 10:53:25 -0500 Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: Hi All, I think we might avoid a lot of problems if we can know what libraries are being loaded and are available before static System loaders are invoked. Toward that end, I have quickly prototyped some code that checks these things. It needs work, but here it is, for what it is worth: powerbook.docjava.com{lyon}10: more NativeLibDetect.java package classUtils.pathUtils; import utils.SystemUtils; import java.io.File; public class NativeLibDetect { private String libLocation = null; public NativeLibDetect(String libName) { libLocation = nativeLibFind( System.mapLibraryName(libName), SystemUtils.getLibraryPaths()); } public static boolean isLibInPath(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation() != null; } public static String getPathToLib(String libName) { NativeLibDetect nld = new NativeLibDetect(libName); return nld.getLibLocation(); } public String nativeLibFind(String libName, String paths[]) { for (int i = 0; i < paths.length; i++) { File f = new File(paths[i]); File fileArray[] = f.listFiles(); for (int j = 0; j < fileArray.length; j++) if (fileArray[j].toString().endsWith(libName)) return fileArray[j].toString(); }//outer Loop return null; } public static void main(String[] args) { System.out.println("zip in path=" + NativeLibDetect.isLibInPath("zip")); System.out.println("zip in path=" + NativeLibDetect.getPathToLib("zip")) ; } public String getLibLocation() { return libLocation; } } Where SystemUtils has a method: public static String[] getLibraryPaths() { String s = getLibraryPath(); StringTokenizer st = new StringTokenizer(s, SystemUtils.getPathSeparator ()); int n = st.countTokens(); String paths[] = new String[n]; for (int i = 0; i < n; i++) paths[i] = st.nextToken(); return paths; } /** * @return return the character use to delimit the paths in a list of * paths. */ public static String getPathSeparator() { return System.getProperty("path.separator"); } Something like the above attempts to match the load order of the default library paths. Interesting things will happen if the libraries overlay each other in different locations. Detecting this overlap would be a logical next step, with a proper warning/exception, as a result. Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. This is due, in part, to a limitation that prevents the catching of exceptions when a library is not found. Is there a work-around for that one? Thanks! - Doug From tjarvi at qbang.org Tue Dec 27 09:51:10 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 09:51:10 -0700 (MST) Subject: [Rxtx] guarding the input In-Reply-To: References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: >> Also interesting is the occasion when Java versions go somewhat out of date with respect to their native counterparts. In order to test these things before loading, I suspect meta information is needed in an XML file, loaded into the Jar. An alternative might be to create some kind of a dummy class loader, with an isolated name space....but first we have to make sure that the load will not fail at run time. << Just one thought here so far. On linux, Mac OS X and Unix, the library is usually installed as a symbolic link to the library with version information in the name if "make install" is used. I think windows is getting symbolic links in Vista. -- Trent Jarvi tjarvi at qbang.org From shauvikr at yahoo.com Wed Dec 28 00:52:21 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Message-ID: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/72e3c891/attachment-0002.html From christopher.dawes at ants.me.uk Wed Dec 28 01:52:09 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:52:09 +0000 Subject: [Rxtx] Sample code needed Message-ID: <1135759929.43b2523927c2e@webmail.freedom2surf.net> http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. From pbarthelemy at aim.com Wed Dec 28 03:45:15 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 05:45:15 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From pbarthelemy at aim.com Wed Dec 28 04:29:06 2005 From: pbarthelemy at aim.com (pbarthelemy@aim.com) Date: Wed, 28 Dec 2005 06:29:06 -0500 Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> Message-ID: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> a tiny URL work better : http://tinyurl.com/bwdxb , by the way -----Original Message----- From: pbarthelemy at aim.com To: rxtx at qbang.org Sent: Wed, 28 Dec 2005 05:45:15 -0500 Subject: Re: [Rxtx] Sample code needed Hi, Some time ago, I've started this sample app, to demonstrate rxtx + swing. Altough, I personaly use eclipse, there is no specific info on the IDE configuration. http://pbarthelemy.blogspirit.com/archive/2005/10/02/rxtxswingdemoforj2se 14-rxtx-org-swing-sample.html I am kind of stuck on this : as I really do not manage to get the communication to work, I did not put the finishing touch to this sample? I'll devote some more time in the coming week. I also mentionned that I will contribute a configuration UI to rxtx.org. More on this to come?. ---p -----Original Message----- From: Shauvik Roy Choudhary To: rxtx at qbang.org Sent: Tue, 27 Dec 2005 23:52:21 -0800 (PST) Subject: [Rxtx] Sample code needed Hi, Can anyone please post a sample serial port read and write code... I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to use RXTX 2.1 for serial port communication. I am a novice in Java and don't know much about serial port programming in Java. Any help in providing the instructions for setting up the RXTXcomm.jar and rxtxSerial.dll would also be appreciated.. Thanx in Advance.. Regards, Shauvik Regards, Shauvik Roy Choudhary. -------- Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. From tjarvi at qbang.org Wed Dec 28 04:34:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 04:34:03 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> <8C7D9B2EC0AA16E-D8C-107CE@FWM-D29.sysops.aol.com> <8C7D9B90C3A6291-B90-1B29@mblk-d22.sysops.aol.com> Message-ID: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org From hama at cyberonix.co.jp Wed Dec 28 05:15:44 2005 From: hama at cyberonix.co.jp (hama@cyberonix.co.jp) Date: Wed, 28 Dec 2005 21:15:44 +0900 Subject: [Rxtx] Where can I get the latest rxtx-2.1 on CVS Message-ID: <051228211544.M1120594@skyplate.cyberonix.co.jp> Hi, how can I get the latest CVS version of rxtx-2.1? I found the description on the web page: http://users.frii.com/jarvi/rxtx/cvs.html So I logged in, and checked out rxtx-devel. Then I ran ./configure . At the end of the process, it requires comm.jar . Isn't it for rxtx-2.0? RXTXcomm.jar is used for rxtx-2.1 , so comm.jar is not necessary. By the way, I found ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050612.zip Is this zip file the newest one what I can get? Thanks in advance, ------------------------------------------------ Takeshi "Ken" Hamasaki : hama at cyberonix.co.jp From shauvikr at yahoo.com Wed Dec 28 05:42:08 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:08 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <1135759929.43b2523927c2e@webmail.freedom2surf.net> Message-ID: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Hi Christopher, Your code runs but i am not getting any response on the serial port... I tried connecting a null modem on my serial port and connected the other end to another CPU... http://www.roboticsindia.com/public/images/uart/null_modem.gif Sending characters via Windows hyper terminal works perfect... but no success with you application... Also, it doesn't stop and seems to be waiting for something... On the console, i get this:- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre17 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7pre17 native lib Version = RXTX-2.1-7pre20 Someone, Please see into the matter and help me out... Regards, Shauvik PS: i run a Win2k3 m/c a with jdk 1.5 and use eclipse ide to program in java christopher.dawes at ants.me.uk wrote: http://www.christopherdawes.f2s.com/SampleEclipseRXTXProject.zip Above's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/8ef0ad46/attachment-0003.html From shauvikr at yahoo.com Wed Dec 28 05:42:33 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 04:42:33 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <20051228124233.36520.qmail@web52705.mail.yahoo.com> Yeah please do it ... Trent Jarvi wrote: If there is interest, we can put a wiki for rxtx up in which people can work together on documentation and examples. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! for Good - Make a difference this year. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/1fce4817/attachment-0002.html From tjarvi at qbang.org Wed Dec 28 06:17:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Dec 2005 06:17:08 -0700 (MST) Subject: [Rxtx] Sample code needed In-Reply-To: <20051228124208.96590.qmail@web52709.mail.yahoo.com> References: <20051228124208.96590.qmail@web52709.mail.yahoo.com> Message-ID: On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > You want to find a jar that matches your native version. Perhaps you have two jars installed. But when you have bothe the native and jar libs installed the above will match. While rxtx tries to maintain the same advertised public methods in rxtx 2.1, sometimes the internal interaction between the jar and native lib changes. This means if you use different versions, you should not have to change your code but the rxtx versions must match. A native lib looks like libRXTXSerial.so or .dll on windows. a jar looks like RXTXcomm.jar There is only one version shipped in a package from rxtx.org. So you probably installed two packages differently at some point. This can cause real problems _inside_ rxtx. From Christopher.Dawes at ants.me.uk Wed Dec 28 12:14:10 2005 From: Christopher.Dawes at ants.me.uk (Christopher Dawes) Date: Wed, 28 Dec 2005 19:14:10 -0000 Subject: [Rxtx] Sample code needed In-Reply-To: Message-ID: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > -------------- next part -------------- A non-text attachment was scrubbed... Name: exampleHyperTermSetup.ht Type: application/octet-stream Size: 1531 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/81d74860/exampleHyperTermSetup-0003.obj From ideiglenes1 at freemail.hu Thu Dec 29 11:48:46 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 19:48:46 +0100 Subject: [Rxtx] forced close of port Message-ID: <1135882126.18893.4.camel@localhost> Hi Rxtx mailing list people! I am using rxtx for communication on bluetooth rfcomm serial device. Rxtx is working well and is perfectly usable. But.. I have one small problem with closing the port. As this is a bluetooth connection, bt unit can close its connection on one side without notification. It is just a binded rfcomm connection. In that case later, when program tries to write on connection, it return write error. I want to handle it, and close the port, but it is blocked by RXTXPort's IOLock! there is an unfinished and failed write attempt, IOLock is increased ++, and so I cannot close the port for later reuse! Can you please provide a forced close, or some kindof closeing which will make the port reusable again after a broken connection? Thanks, Paul From g.telkamp at domologic.de Thu Dec 29 11:58:24 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Thu, 29 Dec 2005 19:58:24 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: <47047718.20051229195824@domologic.de> Hi, I think I've had the same problem some months on a windows platform. Please try out the attached patch. It simply replaces some files of your the current source directory (I've made also some beautifications here). If it works, give us a note, so my patches could be brought into the current cvs repository. Best regards, Gerrit. > Hi Rxtx mailing list people! > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Thanks, > Paul > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx-patch.zip Type: application/x-zip-compressed Size: 23830 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051229/2a598497/rxtx-patch-0002.bin From tjarvi at qbang.org Thu Dec 29 12:29:21 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 12:29:21 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <1135882126.18893.4.camel@localhost> References: <1135882126.18893.4.camel@localhost> Message-ID: On Thu, 29 Dec 2005, -- wrote: > Hi Rxtx mailing list people! > > I am using rxtx for communication on bluetooth rfcomm serial device. > Rxtx is working well and is perfectly usable. > > But.. I have one small problem with closing the port. As this is a > bluetooth connection, bt unit can close its connection on one side > without notification. It is just a binded rfcomm connection. In that > case later, when program tries to write on connection, it return write > error. I want to handle it, and close the port, but it is blocked by > RXTXPort's IOLock! there is an unfinished and failed write attempt, > IOLock is increased ++, and so I cannot close the port for later reuse! > Can you please provide a forced close, or some kindof closeing which > will make the port reusable again after a broken connection? > Does something like this solve the problem? There are 3 writes so the code could either be cleaned up or look for the writeArrays to hack it into RXTXPort.java. try { writeArray( send, 0, len, monThreadisInterrupted ); } catch ( IOException e ) { IOLocked--; throw e; } From ideiglenes1 at freemail.hu Thu Dec 29 13:15:11 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:15:11 +0100 Subject: [Rxtx] forced close of port In-Reply-To: References: <1135882126.18893.4.camel@localhost> Message-ID: <1135887311.18895.7.camel@localhost> That's exactly what I saw would be necessary to handle the situation. The patch Gerrit has kindly sent me didnt help my problem. This one you wrote I think will. I will patch it by own hand right now and tell what happened. Thanks! On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > On Thu, 29 Dec 2005, -- wrote: > > > Hi Rxtx mailing list people! > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > Rxtx is working well and is perfectly usable. > > > > But.. I have one small problem with closing the port. As this is a > > bluetooth connection, bt unit can close its connection on one side > > without notification. It is just a binded rfcomm connection. In that > > case later, when program tries to write on connection, it return write > > error. I want to handle it, and close the port, but it is blocked by > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > IOLock is increased ++, and so I cannot close the port for later reuse! > > Can you please provide a forced close, or some kindof closeing which > > will make the port reusable again after a broken connection? > > > > > Does something like this solve the problem? There are 3 writes so the > code could either be cleaned up or look for the writeArrays to hack it > into RXTXPort.java. > > try { > writeArray( send, 0, len, monThreadisInterrupted ); > } catch ( IOException e ) > { > IOLocked--; > throw e; > } > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From ideiglenes1 at freemail.hu Thu Dec 29 13:21:08 2005 From: ideiglenes1 at freemail.hu (--) Date: Thu, 29 Dec 2005 21:21:08 +0100 Subject: [Rxtx] forced close of port In-Reply-To: <1135887311.18895.7.camel@localhost> References: <1135882126.18893.4.camel@localhost> <1135887311.18895.7.camel@localhost> Message-ID: <1135887668.18895.11.camel@localhost> Okay, its working now. Port can be closed and I can reuse it in a whole new connection if BT unit is in reach again. Thanks for the help! Please include this in the next release, so I can release my software with this new functionality... (until now I had to System.exit() and restart program with the my runner shell script ;-) ) If I can release I will send you my brand new application's link so you can include it in your RXTX homepage's 'what project uses RXTX' page. :) On cs, 2005-12-29 at 21:15 +0100, -- wrote: > That's exactly what I saw would be necessary to handle the situation. > The patch Gerrit has kindly sent me didnt help my problem. This one you > wrote I think will. I will patch it by own hand right now and tell what > happened. > Thanks! > > On cs, 2005-12-29 at 12:29 -0700, Trent Jarvi wrote: > > On Thu, 29 Dec 2005, -- wrote: > > > > > Hi Rxtx mailing list people! > > > > > > I am using rxtx for communication on bluetooth rfcomm serial device. > > > Rxtx is working well and is perfectly usable. > > > > > > But.. I have one small problem with closing the port. As this is a > > > bluetooth connection, bt unit can close its connection on one side > > > without notification. It is just a binded rfcomm connection. In that > > > case later, when program tries to write on connection, it return write > > > error. I want to handle it, and close the port, but it is blocked by > > > RXTXPort's IOLock! there is an unfinished and failed write attempt, > > > IOLock is increased ++, and so I cannot close the port for later reuse! > > > Can you please provide a forced close, or some kindof closeing which > > > will make the port reusable again after a broken connection? > > > > > > > > > Does something like this solve the problem? There are 3 writes so the > > code could either be cleaned up or look for the writeArrays to hack it > > into RXTXPort.java. > > > > try { > > writeArray( send, 0, len, monThreadisInterrupted ); > > } catch ( IOException e ) > > { > > IOLocked--; > > throw e; > > } > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Thu Dec 29 16:10:45 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Dec 2005 16:10:45 -0700 (MST) Subject: [Rxtx] forced close of port In-Reply-To: <47047718.20051229195824@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: On Thu, 29 Dec 2005, Gerrit Telkamp wrote: > Hi, > > I think I've had the same problem some months on a windows platform. > Please try out the attached patch. It simply replaces some files of > your the current source directory (I've made also some beautifications > here). If it works, give us a note, so my patches could be brought > into the current cvs repository. > > Best regards, > > Gerrit. Hi Gerrit I'm interested in getting patches into rxtx that would help all the projects. This is a little awkward as they are just files. If you break the patches into concepts (especially break out code cleanups seperate) and post them here, we can put the changes in if everyone agrees. The key is to have patches that everyone can understand so they can object if it may break what they are doing. With open source projects you see patches go in like this thread from another mail-list: # [patch 09/11] mutex subsystem, debugging code # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html Each patch is a concept. Then if there are objections (as with 04/11) to a specific concept, others can raise concerns. If its hard for you to break out, it is especially hard for members on the list that did not make the changes to follow. -- Trent Jarvi tjarvi at qbang.org From christopher.dawes at ants.me.uk Wed Dec 28 01:42:07 2005 From: christopher.dawes at ants.me.uk (christopher.dawes@ants.me.uk) Date: Wed, 28 Dec 2005 08:42:07 +0000 Subject: [Rxtx] Sample code needed In-Reply-To: <20051228075221.8389.qmail@web52704.mail.yahoo.com> References: <20051228075221.8389.qmail@web52704.mail.yahoo.com> Message-ID: <1135759327.43b24fdf046d7@webmail.freedom2surf.net> Here's a sample eclipse project, unzip it to your hard disk and then in eclipse File - Import - Existing Project Into Workspace (Next) Hit browse and browse to the directory you extracted the zip file to, and hit OK, tick the "SampleEclipseRXTXProject" and hit "Finish". You should then end up with a complete project (origionally compiled under Java 1.4.2_07). Look in the SRC dir then in the only package and you'll see a class called "SampleReaderWriter", in here you'll find the requested sample code. Hope this helps christopher Quoting Shauvik Roy Choudhary : > Hi, > > Can anyone please post a sample serial port read and write code... > I use IBM Eclipse IDE on a Windows 2k3 machine. I have jdk 1.5 and intend to > use RXTX 2.1 for serial port communication. > > I am a novice in Java and don't know much about serial port programming in > Java. > Any help in providing the instructions for setting up the RXTXcomm.jar and > rxtxSerial.dll would also be appreciated.. > > Thanx in Advance.. > > Regards, > Shauvik > > > > Regards, > Shauvik Roy Choudhary. > > > > --------------------------------- > Yahoo! for Good - Make a difference this year. -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/x-zip-compressed Size: 157270 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/3506e119/SampleEclipseRXTXProject-0002.bin From shauvikr at yahoo.com Wed Dec 28 22:23:41 2005 From: shauvikr at yahoo.com (Shauvik Roy Choudhary) Date: Wed, 28 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Sample code needed In-Reply-To: <200512281914.jBSJDxch030701@outmail.freedom2surf.net> Message-ID: <20051229052341.94650.qmail@web52703.mail.yahoo.com> Yeah.. changed the .dll and jar files to the latest ones.. It works perfect now on my Win 2k3 / eclipse/ jdk1.5.. Thanx Christopher and Trent for the help.. :) Will keep mailing progress details of my project... Regards, Shauvik Roy Choudhary http://shauvik.com PS: Attached is the same project with updated .jar and .dll files. Christopher Dawes wrote: What's happened is you've already installed the dll files in your java libraries folder, this isn't a problem, just update the jar file in the lib folder in the eclipse workspace with the one you've downloaded. In hyper terminal what are your port settings, I've used 9600, this needs to be the same both ends. I've also used 8 data bits, no parity and 1 stop bit and no flow control. I've attached an example hyperterm setting. Kind Regards Christopher Dawes -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: 28 December 2005 13:17 To: RXTX Developers and Users Subject: Re: [Rxtx] Sample code needed On Wed, 28 Dec 2005, Shauvik Roy Choudhary wrote: > Hi Christopher, > > Your code runs but i am not getting any response on the serial port... > I tried connecting a null modem on my serial port and connected the other end to another CPU... > http://www.roboticsindia.com/public/images/uart/null_modem.gif > > Sending characters via Windows hyper terminal works perfect... but no success with you application... > > Also, it doesn't stop and seems to be waiting for something... > On the console, i get this:- > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre17 > WARNING: RXTX Version mismatch > Jar version = RXTX-2.1-7pre17 > native lib Version = RXTX-2.1-7pre20 > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx Regards, Shauvik Roy Choudhary. --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: SampleEclipseRXTXProject.zip Type: application/zip Size: 158505 bytes Desc: 62591459-SampleEclipseRXTXProject.zip Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051228/037fb942/SampleEclipseRXTXProject-0002.zip From g.telkamp at domologic.de Fri Dec 30 04:29:57 2005 From: g.telkamp at domologic.de (Gerrit Telkamp) Date: Fri, 30 Dec 2005 12:29:57 +0100 Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> Message-ID: <9566540734.20051230122957@domologic.de> As proposed by Trent, I will describe my patches here: 1- The main patch was in termios.c line 1188, where a close-Method is called when an error occured (cause by check_port_capabilities). It is wrong to call close() here, because termios.c used CreateFile to open the port (in the function open_port). Therefore, "serial_close" has to be called, updating the internal port management structure. I think the origin is that in a previous release of RXTX this function has been named "close()", later renamed to "serial_close()". In several debug outputs you also find "close" instead of "serial_close" and "open" instead of "serial_open" (Lines 606,615,632,668,863,1170,1178). I would also propose to update these debug outputs, because it confused me while reading the code. 2- in "Serial.def", Line 4, the export declaration of "nativeGetVersion" is wrong (the JNI method declaration is done in RXTXVersion.java, not in RXTXCommDriver.java) Line 4 Replaced by Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 3- in "Configure.java", Line 160: Wrong message, because the name of the properties file is "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") The message could cause some confusion. 4- In my environment, I get an error message because the JNI functions JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in SerialImp.c. The declaration in init.c is not used anymore, so I propose to comment it out. Best regards, Gerrit. > On Thu, 29 Dec 2005, Gerrit Telkamp wrote: >> Hi, >> >> I think I've had the same problem some months on a windows platform. >> Please try out the attached patch. It simply replaces some files of >> your the current source directory (I've made also some beautifications >> here). If it works, give us a note, so my patches could be brought >> into the current cvs repository. >> >> Best regards, >> >> Gerrit. > Hi Gerrit > I'm interested in getting patches into rxtx that would help all the > projects. This is a little awkward as they are just files. > If you break the patches into concepts (especially break out code cleanups > seperate) and post them here, we can put the changes in if everyone > agrees. > The key is to have patches that everyone can understand so they can object > if it may break what they are doing. With open source projects you see > patches go in like this thread from another mail-list: > # [patch 09/11] mutex subsystem, debugging code > # [patch 06/11] mutex subsystem, add default include/asm-*/mutex.h files > # [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h Ingo > * Re: [patch 04/11] mutex subsystem, add include/asm-x86_64/mutex.h > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > o Re: [patch 04/11] mutex subsystem, add add include/asm-x86_64/ > http://www.ussg.iu.edu/hypermail/linux/kernel/0512.3/index.html > Each patch is a concept. Then if there are objections (as with 04/11) to > a specific concept, others can raise concerns. If its hard for you to > break out, it is especially hard for members on the list that did not make > the changes to follow. > -- > Trent Jarvi > tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 30 08:11:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 30 Dec 2005 08:11:28 -0700 (MST) Subject: [Rxtx] [patch 29/12] serial_close in termios.c In-Reply-To: <9566540734.20051230122957@domologic.de> References: <1135882126.18893.4.camel@localhost> <47047718.20051229195824@domologic.de> <9566540734.20051230122957@domologic.de> Message-ID: On Fri, 30 Dec 2005, Gerrit Telkamp wrote: > As proposed by Trent, I will describe my patches here: > > 1- The main patch was in termios.c line 1188, where a close-Method is > called when an error occured (cause by check_port_capabilities). It is > wrong to call close() here, because termios.c used CreateFile to open > the port (in the function open_port). Therefore, "serial_close" has to > be called, updating the internal port management structure. > > I think the origin is that in a previous release of RXTX this function > has been named "close()", later renamed to "serial_close()". In > several debug outputs you also find "close" instead of "serial_close" > and "open" instead of "serial_open" (Lines > 606,615,632,668,863,1170,1178). I would also propose to update these > debug outputs, because it confused me while reading the code. > > 2- in "Serial.def", Line 4, the export declaration of > "nativeGetVersion" is wrong (the JNI method declaration > is done in RXTXVersion.java, not in RXTXCommDriver.java) > Line 4 Replaced by > Java_gnu_io_RXTXVersion_nativeGetVersion=Java_gnu_io_RXTXVersion_nativeGetVersion at 8 > > 3- in "Configure.java", Line 160: > Wrong message, because the name of the properties file is > "gnu.io.rxtx.properties" (not "gnu.io.comm.properties") > The message could cause some confusion. > > 4- In my environment, I get an error message because the JNI functions > JNI_OnLoad and JNI_OnUnload are declared twice: in init.c and in > SerialImp.c. > The declaration in init.c is not used anymore, so I propose to > comment it out. > > Best regards, > > Gerrit. > Hi Gerrit This is great. I'll be looking through this and posting patches to the list tomorrow so everyone can review them. Thats really the responsibility of the person proposing a change but I can go half way. When (if?) your changes go in you can know we will do the same for the next changes so if you watch the list and review the patches, you know your application will not break. From Ricardo.Letosa at sita.aero Fri Dec 30 10:06:48 2005 From: Ricardo.Letosa at sita.aero (Ricardo.Letosa@sita.aero) Date: Fri, 30 Dec 2005 17:06:48 +0000 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. Message-ID: I will be out of the office starting 30/12/2005 and will not return until 09/01/2006. For urgent issues, please call my mobile +34 651 613 285. Happy New Year. From halbleib at rechnerbetriebsgruppe.de Fri Dec 30 10:13:29 2005 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Fri, 30 Dec 2005 18:13:29 +0100 Subject: [Rxtx] Ricardo Letosa/Dublin/SITA/WW is out of the office. In-Reply-To: References: Message-ID: <43B56AB9.50907@rechnerbetriebsgruppe.de> i'll be out of the office too :-) Happy New Year!!! Mit freundlichen Gr??en Tom Halbleib ____________________________________________________ Tom Halbleib Rechnerbetriebsgruppe Phone: 0049 / 931 / 99 13 55 62 Fax: 0049 / 931 / 99 13 55 68 e-Mail: halbleib at rechnerbetriebsgruppe.de WWW : www.rechnerbetriebsgruppe.de Ricardo.Letosa at sita.aero schrieb: > I will be out of the office starting 30/12/2005 and will not return until > 09/01/2006. > > For urgent issues, please call my mobile +34 651 613 285. > Happy New Year. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:06:48 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:06:48 -0500 Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: >Hi Doug > >>"... >>However when I run it on Mac OS X using RXTX >>2.0.7 (installed using fink) I get the >>following error:..." >>When you run: >>http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>Do you get a serial port error when you go to the serial port set-up? >> > >Does you app use RXTX 2.1 (gnu.io namespace)? Yes! >The VCR App uses RXTX 2.0 (javax.comm >namespace). When I try to run JAddressBook I get: > >java.lang.ClassCastException: >gnu.io.RXTXCommDriver thrown while loading >gnu.io.RXTXCommDriver I don't know what is causing that. Trent, do you have any ideas about this? It all seems to work OK here. Perhaps the property of the java.library.path should be echoed. I would guess that you have an incompatible driver loaded into your path, perhaps a non-RXTX driver, or, more likely, one that is in a version that is different from mine. This is a classic error, the detection of which should be a part of our serial port API. I would guess that classes, like the "CommPortIdentifier" class have internal gnu.io name space reference data types...hmm, yes, lines like: // initialization only done once.... static { if(debug) System.out.println("CommPortIdentifier:static initiali zation()"); Sync = new Object(); try { CommDriver RXTXDriver = (CommDriver) Class.forName("gnu. io.RXTXCommDriver").newInstance(); Are static loads of the driver. If the wrong version of the driver comes in, we do not have a way to gracefully exit from the static library load. The issue is hard because JNI libraries are typically loaded once and only once by a given class loader. If they are loaded as wrong versions (i.e. CommDriver instanceof RXTXDriver, fails) then the class cast exception occurs at run time. We could trap this, but then what? Reloading the class into the current class loader, from another location in the java.library.path is not easy (how do you unload the wrong version of the class?). What you need is a dummy class loader that can be used to test the versions of the classes before they are loaded into the primary class loader. Then, if the class fails the instanceof test, we dispense with the dummy class loader and make a new dummy class loader that starts from a subset of the directories in the library path. Does this sound possible? I am only guessing, but two classes in the same name space, loaded by two different class loaders will never satisfy the instanceof test (since they are in different contexts). Thus, we will also have to load the CommDriver interface into the dummy class loader, before initiating the test. This version control thing is such a pain! Does anybody have any thoughts on this? I am at a loss....there has GOTTA be an easier way! > >>I have checked the software with the Griffin Serial Card, >>for the Mac Cube, Port IO and the KeySpan 19HS. All seem to work..so far. >> > >The RXTX I was using works for certain things. >For example I can use it to talk to a GPS with >no problem. It's just in this particular >application (the VCR control) I get an error >with RXTX but not with Java Comm. My Platform is >Power Mac G5/ OS X 10.4.3 using a IOGear?GUC232A >USB-Serial Adapter. Ah ha, hardware I have not tested? Well you know, if you have a spare, I would be happy to test it on my system, and even debug it (if possible). Cheers! - Doug > > >Brian Schlining >Software Engineer >http://www.mbari.org > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Thu Dec 1 07:54:14 2005 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Thu, 01 Dec 2005 09:54:14 -0500 Subject: [Rxtx] versions Message-ID: Hi All, The version of the library is shown in the java web start console as: Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. Devel Library ========================================= Native lib Version = R-testing-XTX-2.1-7pre20noLock Java lib Version = R-testing-XTX-2.1-7pre20noLock In the application: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp - DL From frank-list at uol.com.br Thu Dec 1 13:33:21 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 17:33:21 -0300 Subject: [Rxtx] nativeDrain method necessary? Message-ID: <438F5E11.9040904@uol.com.br> Hi, I'm using a converter to add a serial port using one USB port. I installed the driver without problems and it created the COM5 serial port. At the command prompt, I redirected a directory listing to the serial port (dir > COM5), and it worked fine. But, when using the RXTX library, I got the following error: java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) There is a comment before the call to the function saying "this is probably good on all OS's but for now just sendEvent from java on Sol", so I commented the call to this method, and the port worked fine. I looked at the implementation of nativeDrain in serialImp.c, but couldn't understand what this function does. Would it be a problem to use RXTX without the call to nativeDrain in SerialOutputStream.flush() ? I'm using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response would be greatly appreciated. Thanks, Francisco From tjarvi at qbang.org Thu Dec 1 12:57:43 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 12:57:43 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F5E11.9040904@uol.com.br> References: <438F5E11.9040904@uol.com.br> Message-ID: On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > Hi, I'm using a converter to add a serial port using one USB port. I > installed the driver without problems and it created the COM5 serial > port. At the command prompt, I redirected a directory listing to the > serial port (dir > COM5), and it worked fine. But, when using the RXTX > library, I got the following error: > java.io.IOException: No error in nativeDrain > at gnu.io.RXTXPort.nativeDrain(Native Method) > at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) > > There is a comment before the call to the function saying "this is > probably good on all OS's but for now just sendEvent from java on Sol", > so I commented the call to this method, and the port worked fine. I > looked at the implementation of nativeDrain in serialImp.c, but couldn't > understand what this function does. Would it be a problem to use RXTX > without the call to nativeDrain in SerialOutputStream.flush() ? I'm > using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response > would be greatly appreciated. > If you do not need to know when the output buffer is empty, you don't usually need to worry about the nativeDrain. There are two times when it is used to get around 'issues.' Some OS's like Solaris do not support everything available on the UART. A flush is used to know when everything is sent resulting in an output buffer event in rxtx code. Some hardware (less expensive multiport cards) do not have UARTs. Again, it is required to use a flush to know when the data is sent or the output buffer is empty. So the nativeDrain() is closely related to output buffer events on Solaris and some multiport serial boards. For most serial communication, it is not critical. The code in RXTX can follow different paths depending upon the card or OS so it is not overly simple but that is the idea. From tjarvi at qbang.org Thu Dec 1 13:00:53 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:00:53 -0700 (MST) Subject: [Rxtx] mac serial ports In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: >> Hi Doug >> >>> "... >>> However when I run it on Mac OS X using RXTX 2.0.7 (installed using fink) >>> I get the following error:..." >>> When you run: >>> http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp >>> Do you get a serial port error when you go to the serial port set-up? >>> >> >> Does you app use RXTX 2.1 (gnu.io namespace)? > > Yes! > >> The VCR App uses RXTX 2.0 (javax.comm namespace). When I try to run >> JAddressBook I get: >> >> java.lang.ClassCastException: gnu.io.RXTXCommDriver thrown while loading >> gnu.io.RXTXCommDriver > > I don't know what is causing that. Trent, do you have any ideas about this? I would guess that is caused by combining jar files from rxtx 2.0, 2.1 and Sun CommAPI. If you are using rxtx 2.1, clean out the 2.0 and Sun jars from your classpath/ext directory. Just install one or the other. From tjarvi at qbang.org Thu Dec 1 13:05:36 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 13:05:36 -0700 (MST) Subject: [Rxtx] versions In-Reply-To: References: Message-ID: On Thu, 1 Dec 2005, Dr. Douglas Lyon wrote: > Hi All, > The version of the library is shown in the java web start console as: > Java Web Start 1.4.2_07 Console, started Thu Dec 01 09:49:48 EST 2005 > Java 2 Runtime Environment: Version 1.4.2_07 by Apple Computer, Inc. > Devel Library > ========================================= > Native lib Version = R-testing-XTX-2.1-7pre20noLock > Java lib Version = R-testing-XTX-2.1-7pre20noLock > In the application: > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > The noLock just indicates it is configured with --disable-lockfiles. I put that together to check if disabling lockfiles would help with a problem I've since forgot. It's just RXTX-2.1-7pre20 ../configure --disable-lockfiles make The version information was mangled to make sure the nolock version was loaded while discussing problems. There are no secret versions :) From frank-list at uol.com.br Thu Dec 1 14:16:16 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Thu, 01 Dec 2005 18:16:16 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> Message-ID: <438F6820.9050504@uol.com.br> I'm always amazed by how fast you reply. Thanks. Do you know what could be causing that error? Could it be because it is a "false" serial port? Francisco Trent Jarvi wrote: > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> Hi, I'm using a converter to add a serial port using one USB port. I >> installed the driver without problems and it created the COM5 serial >> port. At the command prompt, I redirected a directory listing to the >> serial port (dir > COM5), and it worked fine. But, when using the RXTX >> library, I got the following error: >> java.io.IOException: No error in nativeDrain >> at gnu.io.RXTXPort.nativeDrain(Native Method) >> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >> >> There is a comment before the call to the function saying "this is >> probably good on all OS's but for now just sendEvent from java on Sol", >> so I commented the call to this method, and the port worked fine. I >> looked at the implementation of nativeDrain in serialImp.c, but couldn't >> understand what this function does. Would it be a problem to use RXTX >> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >> would be greatly appreciated. >> > > > If you do not need to know when the output buffer is empty, you don't > usually need to worry about the nativeDrain. There are two times when > it is used to get around 'issues.' > > Some OS's like Solaris do not support everything available on the > UART. A flush is used to know when everything is sent resulting in an > output buffer event in rxtx code. > > Some hardware (less expensive multiport cards) do not have UARTs. > Again, it is required to use a flush to know when the data is sent or > the output buffer is empty. > > So the nativeDrain() is closely related to output buffer events on > Solaris and some multiport serial boards. For most serial > communication, it is not critical. > > The code in RXTX can follow different paths depending upon the card or > OS so it is not overly simple but that is the idea. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu Dec 1 16:44:09 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Dec 2005 16:44:09 -0700 (MST) Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: <438F6820.9050504@uol.com.br> References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: What happens with 'No error' is a bit confusing. The sourcecode on W32 (which I guess this is) is trying to flush the data out the port and the windows API is giving an Error. The USB port isn't a UART chip. It probably does not support the call. But rxtx tries ( and sometimes really poorly ) to convert the MSFT error into a meaningful message. The error is happening in tcdrain() in termios.c. There is a YACK() macro which should output what the windows error is on console if there is one. I think the YACK() should be talking if there is an error. YACK is defined in win32termios.h. I'm guessing that USB driver just does not support the windows call "FlushFileBuffers( HComm )" and is returning an error. The drawbacks are no outputbuffer empty messages when rxtx depends upon tcdrain to know when it is empty and it isnt possible to flush the data out before doing more tasks. In most cases it would be harmless. On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > I'm always amazed by how fast you reply. Thanks. Do you know what could be > causing that error? Could it be because it is a "false" serial port? > > Francisco > > > Trent Jarvi wrote: > >> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >> >>> Hi, I'm using a converter to add a serial port using one USB port. I >>> installed the driver without problems and it created the COM5 serial >>> port. At the command prompt, I redirected a directory listing to the >>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>> library, I got the following error: >>> java.io.IOException: No error in nativeDrain >>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>> >>> There is a comment before the call to the function saying "this is >>> probably good on all OS's but for now just sendEvent from java on Sol", >>> so I commented the call to this method, and the port worked fine. I >>> looked at the implementation of nativeDrain in serialImp.c, but couldn't >>> understand what this function does. Would it be a problem to use RXTX >>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>> would be greatly appreciated. >>> >> >> >> If you do not need to know when the output buffer is empty, you don't >> usually need to worry about the nativeDrain. There are two times when it >> is used to get around 'issues.' >> >> Some OS's like Solaris do not support everything available on the UART. A >> flush is used to know when everything is sent resulting in an output buffer >> event in rxtx code. >> >> Some hardware (less expensive multiport cards) do not have UARTs. Again, >> it is required to use a flush to know when the data is sent or the output >> buffer is empty. >> >> So the nativeDrain() is closely related to output buffer events on Solaris >> and some multiport serial boards. For most serial communication, it is not >> critical. >> >> The code in RXTX can follow different paths depending upon the card or OS >> so it is not overly simple but that is the idea. >> >> _______________________________________________ >> 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 > From frank-list at uol.com.br Fri Dec 2 06:31:32 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 10:31:32 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43904CB4.7010301@uol.com.br> Thanks again. I think I will try it without the call to tcdrain. Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From frank-list at uol.com.br Fri Dec 2 12:23:59 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Fri, 02 Dec 2005 16:23:59 -0300 Subject: [Rxtx] nativeDrain method necessary? In-Reply-To: References: <438F5E11.9040904@uol.com.br> <438F6820.9050504@uol.com.br> Message-ID: <43909F4F.9070801@uol.com.br> Hi again, I managed to capture the message from YACK: Error 0xb7 at c:\eclipse\workspace\\binsrc\rxtx\rxtxserial\termios.c(2710): Cannot create a file when that file already exists. Does this means that the port is already in use? Francisco Trent Jarvi wrote: > > What happens with 'No error' is a bit confusing. The sourcecode on > W32 (which I guess this is) is trying to flush the data out the port > and the windows API is giving an Error. The USB port isn't a UART > chip. It probably does not support the call. But rxtx tries ( and > sometimes really poorly ) to convert the MSFT error into a meaningful > message. > > The error is happening in tcdrain() in termios.c. There is a YACK() > macro which should output what the windows error is on console if > there is one. I think the YACK() should be talking if there is an > error. YACK is defined in win32termios.h. > > I'm guessing that USB driver just does not support the windows call > "FlushFileBuffers( HComm )" and is returning an error. The drawbacks > are no outputbuffer empty messages when rxtx depends upon tcdrain to > know when it is empty and it isnt possible to flush the data out > before doing more tasks. > > In most cases it would be harmless. > > On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: > >> I'm always amazed by how fast you reply. Thanks. Do you know what >> could be causing that error? Could it be because it is a "false" >> serial port? >> >> Francisco >> >> >> Trent Jarvi wrote: >> >>> On Thu, 1 Dec 2005, Francisco Areas Guimaraes wrote: >>> >>>> Hi, I'm using a converter to add a serial port using one USB port. I >>>> installed the driver without problems and it created the COM5 serial >>>> port. At the command prompt, I redirected a directory listing to the >>>> serial port (dir > COM5), and it worked fine. But, when using the RXTX >>>> library, I got the following error: >>>> java.io.IOException: No error in nativeDrain >>>> at gnu.io.RXTXPort.nativeDrain(Native Method) >>>> at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1248) >>>> >>>> There is a comment before the call to the function saying "this is >>>> probably good on all OS's but for now just sendEvent from java on >>>> Sol", >>>> so I commented the call to this method, and the port worked fine. I >>>> looked at the implementation of nativeDrain in serialImp.c, but >>>> couldn't >>>> understand what this function does. Would it be a problem to use RXTX >>>> without the call to nativeDrain in SerialOutputStream.flush() ? I'm >>>> using RXTX-2.0-7pre2, on a win2000 with java 1.4.2_05. Any response >>>> would be greatly appreciated. >>>> >>> >>> >>> If you do not need to know when the output buffer is empty, you >>> don't usually need to worry about the nativeDrain. There are two >>> times when it is used to get around 'issues.' >>> >>> Some OS's like Solaris do not support everything available on the >>> UART. A flush is used to know when everything is sent resulting in >>> an output buffer event in rxtx code. >>> >>> Some hardware (less expensive multiport cards) do not have UARTs. >>> Again, it is required to use a flush to know when the data is sent >>> or the output buffer is empty. >>> >>> So the nativeDrain() is closely related to output buffer events on >>> Solaris and some multiport serial boards. For most serial >>> communication, it is not critical. >>> >>> The code in RXTX can follow different paths depending upon the card >>> or OS so it is not overly simple but that is the idea. >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From vinayak.ghate at softdel.com Sun Dec 4 22:44:07 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Mon, 5 Dec 2005 11:14:07 +0530 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051204/e451bce7/attachment-0003.html 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 edmundwatson at gmail.com Mon Dec 12 10:03:59 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Mon, 12 Dec 2005 17:03:59 +0000 Subject: [Rxtx] AMD64/Gentoo Problems Message-ID: <4223ad60512120903l1b4a062cuc2ec95ac0606cff7@mail.gmail.com> I am running Sempron 3000+ With Gentoo Install Running a 2.6.14 Kernel Running Sun VM 1.5 Update 6 (64-bit) I CVS version *tried *rxtx-2.1-CVS-20050120 and rxtx-2.1-CVS-20050612 both compiled from source using ./configure, make , make install SimpleRead.java and SimpleWrite.java (from java comm api changed import to import gnu.io.*;) Compiled Fine SimpleWrite work as far as i can see Simple Read as soon at it get to read from the input stream int numBytes = inputStream.read(readBuffer); Throws the below error any ideas? Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00002aaafb405942, pid=23369, tid=163851 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_05-b05 mixed mode) # Problematic frame: # C [librxtxSerial.so+0x5942] read_byte_array+0x52 # # An error report file with more information is saved as hs_err_pid23369.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Killed -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051212/0236c832/attachment-0003.html From oyvind.harboe at zylin.com Tue Dec 13 06:48:27 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Tue, 13 Dec 2005 14:48:27 +0100 Subject: [Rxtx] Problems with RXTXPort.java close method taking too long Message-ID: <1134481707.25350.6.camel@localhost.localdomain> The close() method takes ca. 300-400ms on my Debian Linux box. This is problematic since I want my application to leave the serial port accessible to other applications when it is not being used by the Java application, e.g. minicom. I can not know if I need to send more commands in the future, so I close the serial port as soon as I'm done. Is this behaviour by RXTX intentional? Suggestions? -- ?yvind Harboe http://www.zylin.com From nigel.magnay at gmail.com Tue Dec 13 14:39:19 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue, 13 Dec 2005 21:39:19 +0000 Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512111506i16b2f585x@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> Message-ID: <320075ff0512131339t7c175d5ao@mail.gmail.com> Done a bit more digging - the native code seems to run fine, it's crashing when returning back to java for some reason. Hmm.. anyone any ideas? On 11/12/05, Nigel Magnay wrote: > 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 tjarvi at qbang.org Tue Dec 13 16:31:08 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Dec 2005 16:31:08 -0700 (MST) Subject: [Rxtx] Re: rxtx and arm linux problem In-Reply-To: <320075ff0512131339t7c175d5ao@mail.gmail.com> References: <320075ff0512111506i16b2f585x@mail.gmail.com> <320075ff0512131339t7c175d5ao@mail.gmail.com> Message-ID: On Tue, 13 Dec 2005, Nigel Magnay wrote: > Done a bit more digging - the native code seems to run fine, it's > crashing when returning back to java for some reason. > > Hmm.. anyone any ideas? An older version of rxtx with an older JRE :) Have you tried reproducing this on the x86 machine you are cross compiling from? Just a sanity check. If it happens there I can take a look. From vinayak.ghate at softdel.com Fri Dec 16 00:32:55 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 16 Dec 2005 13:02:55 +0530 Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. Message-ID: Hi all, I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when I'm trying to use comm apis in my application. I'm trying to probe how many serial and parallel ports available on the system. But when i'm trying to run this application it is giving me following error. Experimental: JNI_OnLoad called. Devel Library ========================================= Native lib Version = RXTX-2.0-7pre2 Java lib Version = RXTX-2.0-7pre2 Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at ListPorts.main(ListPorts.java:6) I'm new to Java world so really can't figure out which library is missing when I'm trying to run this application. I have ensured that comm.jar, RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so files are in proper folders as specified in the INSTALL document. Can anybody help me resolve this problem and explain to me what is going wrong in this case? Thanks in advance. Best Regards, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051216/ce634367/attachment-0003.html From tjarvi at qbang.org Fri Dec 16 02:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 02:29:34 -0700 (MST) Subject: [Rxtx] Problem with "rxtx-2.0-7pre2" commapi. In-Reply-To: References: Message-ID: On Fri, 16 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have built comm apis using sources for "rxtx-2.0-7pre2" package. I am > using jdk 1.4.2 from blackdown for this purpose. I am getting a problem when > I'm trying to use comm apis in my application. I'm trying to probe how many > serial and parallel ports available on the system. But when i'm trying to > run this application it is giving me following error. > > Experimental: JNI_OnLoad called. > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre2 > Java lib Version = RXTX-2.0-7pre2 > Exception in thread "main" java.lang.UnsatisfiedLinkError: isSessionActive > > I'm new to Java world so really can't figure out which library is missing > when I'm trying to run this application. I have ensured that comm.jar, > RXTXComm.jar, javax.comm.properties, librxtxserial.so and librxtxParallel.so > files are in proper folders as specified in the INSTALL document. > Can anybody help me resolve this problem and explain to me what is going > wrong in this case? > Hi Vinay Hmm. javax.comm 3.* appears to be a horrible hack in this regard. I'm just glancing at things right now, but it appears that Sun has hardcoded native functions into their new native library in a fairly hostile fashion. java.lang.Object extended bycom.sun.comm.SunrayInfo static java.lang.String getDTUdevRoot(java.lang.String terminalId) Native function to get Sun Ray DTU devroot given it's terminal ID static java.lang.String getSessionDevRoot() Native function to get Sun Ray session device root. static java.lang.String getSessionTerminalId() Native function to get Sun Ray session device root. static boolean isDTUonline(java.lang.String terminalId) Native function to determine if a particular DTU is online static boolean isSessionActive() Return true if running in a Sun Ray session. Sun is further hardcoding the loading of their native library which is not going to work for rxtx. Their native library is useless on Linux ARM for instance. I could list dozens of corner cases this breaks. This is a very bad hack on Sun's part and isn't acceptable for a wide range of rxtx users. That native library will have to go when javax.comm.properties are not set to Sun or we will just have to go with rxtx 2.1 and stop working with Sun. I would suggest using rxtx 2.1 and leave javax.comm alone until Sun resolves this poor design. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri Dec 16 05:04:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 16 Dec 2005 05:04:16 -0700 (MST) Subject: [Rxtx] Test of mail archive Message-ID: Further down the todo list.. The directory the archives had been going to was wrong. With luck the archives will all (post 2003 when we started the mail list) be available now at the following URL. I set it to update hourly so we should see this post there too soon enough. http://mailman.qbang.org/pipermail/rxtx/ -- Trent Jarvi tjarvi at qbang.org From vinayak.ghate at softdel.com Fri Dec 2 04:43:38 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Fri, 02 Dec 2005 11:43:38 -0000 Subject: [Rxtx] Application crashes! 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. I have followed the instructions provided in the INSTALL document to copy the necessary files in respective folders as mentioned there. But when I'm trying to run my application which probes the ports available on my system, it crashes and gives me core dump as follows; An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(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 you help me to resolve this problem? What must be causing this problem? Thanks and regard, Vinay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051202/5a5a5391/attachment-0003.html 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 tjarvi at qbang.org Sat Dec 17 06:37:59 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:37:59 -0700 (MST) Subject: [Rxtx] RXTX In-Reply-To: <006601c5ce4f$d35812f0$080110ac@INFPC005> References: <006601c5ce4f$d35812f0$080110ac@INFPC005> Message-ID: On Tue, 11 Oct 2005, Philippe Couas wrote: > Hi, > > Could you says me if your Javacomm API is running on AIX 4.3.3.0 ? RXTX 2.1 will but now that Sun has hardcoded its native libraries, rxtx 2.0 no longer does. The solution for now is to use package gnu.io instead of javax.comm. The build can be somewhat involved on AIX as you need autoconf, automake, GNU make, .. as mentioned in the source documentation. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:41:20 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:41:20 -0700 (MST) Subject: [Rxtx] Install In-Reply-To: <436E26C6.4090909@rechnerbetriebsgruppe.de> References: <436E26C6.4090909@rechnerbetriebsgruppe.de> Message-ID: On Sun, 6 Nov 2005, Tom Halbleib wrote: > hi all, > > is there a manual for mac osx tiger too? > Hi Tom, The most reliable way to install rxtx is with the command line tools. The rxtx 2.1 cvs should work on tiger. in bash: export CVSROOT=:pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot cvs login (password is mousy) cvs checkout -r commapi-0-0-1 rxtx-devel mkdir rxtx-devel/build cd rxtx-devel/build ../configure && make install -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Dec 17 06:46:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 17 Dec 2005 06:46:37 -0700 (MST) Subject: [Rxtx] Application crashes! In-Reply-To: References: Message-ID: On Fri, 2 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. I have followed the instructions provided in the INSTALL > document to copy the necessary files in respective folders as mentioned > there. But when I'm trying to run my application which probes the ports > available on my system, it crashes and gives me core dump as follows; > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) The binary is not compatible with your system for some reason. You will need to recompile rxtx with tools closer to your system. I suspect your system is older than the one those binaries are compiled on. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Dec 18 19:04:57 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 19:04:57 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. Message-ID: As Sun has changed their library so that most rxtx platforms are broken, the availability of rxtx 2.0 is only going to cause problems. I will be removing the links from the rxtx download page to prevent user confusion. The files will remain in the ftp directory. If Sun fixes their design, we could start supporting the rxtx 2.0 arrangement. Another option, which the license allows, is for rxtx developers to terminate their license agreement with Sun via the EULA and move rxtx into the javax.comm namespace. The license does not appear to be of use to either side anymore. In fact it is hurting the adoption of Java in general. Would others be interested in terminating their agreement with Sun for Java CommAPI? To be clear: If people want to continue obtaining copies of rxtx 2.0, they will remain available at their same locations. They just will not be advertised on the web www.rxtx.org web pages anymore. -- Trent Jarvi tjarvi at qbang.org From dimitris at gmail.com Sun Dec 18 22:18:10 2005 From: dimitris at gmail.com (Dimitris Kogias) Date: Sun, 18 Dec 2005 21:18:10 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <43A64292.60300@gmail.com> Trent Jarvi wrote: > > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. Hi Trent, list members, Is it possible to leave some links to 2.0, perhaps in a "legacy" section of the website? We're releasing some software that uses 2.0 and changing over to 2.1 would cause too much delay for this release. Sun's timing was "impeccable" for us :( Going forward of course we're definitely moving to 2.1/gnu.io. Also looking ahead, I'd also be *very* interested (and could help) in a SelectorProvider (nio) implementation as part of rxtx. Has such a beast been considered? D. From tjarvi at qbang.org Sun Dec 18 22:30:06 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Dec 2005 22:30:06 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <43A64292.60300@gmail.com> References: <43A64292.60300@gmail.com> Message-ID: On Sun, 18 Dec 2005, Dimitris Kogias wrote: > Trent Jarvi wrote: >> >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. > > Hi Trent, list members, > > Is it possible to leave some links to 2.0, perhaps in a "legacy" section > of the website? We could put up a legacy link. Another option which I encourage is to offer the download on your web site if possible. From what I saw at java.sun.com, your application is only going to work on Sun and i386 Linux. There isnt anything we can do about that from here. I do not see that Sun left a download like for 2.0 available though it may be there. If you have a link for legacy support from Sun, I'd be glad to include a that with the rxtx 2.0 link. > > We're releasing some software that uses 2.0 and changing over to 2.1 > would cause too much delay for this release. Sun's timing was > "impeccable" for us :( I'm not interested in making things worse. I'm just starting to get emails regarding 3.0 and want to encourage people towards platform neutral options with or without Sun's implementation in the future. > > Going forward of course we're definitely moving to 2.1/gnu.io. > > Also looking ahead, I'd also be *very* interested (and could help) in a > SelectorProvider (nio) implementation as part of rxtx. Has such a beast > been considered? > I'd be willing to work towards getting an implementation in rxtx. From oyvind.harboe at zylin.com Mon Dec 19 03:45:36 2005 From: oyvind.harboe at zylin.com (=?ISO-8859-1?Q?=D8yvind?= Harboe) Date: Mon, 19 Dec 2005 11:45:36 +0100 Subject: [Rxtx] Proposed patch for close() in RXTX Message-ID: <1134989136.2082.13.camel@localhost.localdomain> My application has run into trouble since close() takes ca. 300-400ms. This is using librxtx-java package in Debian. Q: Does it make sense to fix this in RXTX and submit a patch? Comments? Hints? No response to this message is a satisfactory response to me. I shall interpret as "no" ;-) -- ?yvind Harboe http://www.zylin.com From tjarvi at qbang.org Mon Dec 19 04:23:37 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 04:23:37 -0700 (MST) Subject: [Rxtx] Proposed patch for close() in RXTX In-Reply-To: <1134989136.2082.13.camel@localhost.localdomain> References: <1134989136.2082.13.camel@localhost.localdomain> Message-ID: On Mon, 19 Dec 2005, ?yvind Harboe wrote: > My application has run into trouble since close() takes ca. 300-400ms. > > This is using librxtx-java package in Debian. > > Q: Does it make sense to fix this in RXTX and submit a patch? > > Comments? Hints? > > No response to this message is a satisfactory response to me. I shall > interpret as "no" ;-) > > You are very welcome to post the patch here. We can all take a look and if there are no objections, it will get into rxtx. Please make sure you break the patch down to one 'thing' per patch. This should be easy in your case; "speed up close." Patches that do many things at once tend to get dropped as they become confusing. -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Dec 19 10:06:41 2005 From: brian at mbari.org (Brian Schlining) Date: Mon, 19 Dec 2005 09:06:41 -0800 Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: References: Message-ID: <91D0A6BA-6C3D-40F1-9CB7-3779D0E52494@mbari.org> > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move > rxtx into the javax.comm namespace. The license does not appear to > be of use to either side anymore. In fact it is hurting the > adoption of Java in general. > > Would others be interested in terminating their agreement with Sun > for Java CommAPI? Absolutely. I support the move of rxtx into javax.comm without including dependencies on Sun's libraries. Brian Schlining Software Engineer http://www.mbari.org From tma at mail.island.net Mon Dec 19 15:31:42 2005 From: tma at mail.island.net (Tom Alldread) Date: Mon, 19 Dec 2005 14:31:42 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? Message-ID: <43A734CE.2090405@mail.island.net> Greetings Folks: I am writing an application under java 1.5 using NetBeans 5 beta 2 for the IDE. My application uses a serial port to access data from a microcontroller based data acquisition device. I am running the port at 115,200 K Baud which easily can handle the actual data through put which is about 2K bytes/S. I am using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. I am currently developing the application on the Windows XP platform but would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 comm package would be a good choice to ensure compatibility between both platforms? Does there happen to be a HowTo document on switching over from javax.comm to RXTX 2.1? I am currently using the Sun javax.comm 2.0 package and I am encountering problems with occasional data dropouts. I wonder if anyone here has heard of similar complaints? I noticed that Sun have come out with a version 3.0 communications API package however they don't seem to offer support for Windows with it. It seems the 2.0 javax.comm package is no longer available for download thus I wonder what one is supposed to do to provide serial port support for the Windows platform? I wonder if I overlooked something? Many thanks for reading this! Helpful suggestions would be appreciated. -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Mon Dec 19 16:29:34 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 16:29:34 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A734CE.2090405@mail.island.net> References: <43A734CE.2090405@mail.island.net> Message-ID: On Mon, 19 Dec 2005, Tom Alldread wrote: > Greetings Folks: > > I am writing an application under java 1.5 using NetBeans 5 beta 2 for the > IDE. My application uses a serial port to access data from a microcontroller > based data acquisition device. I am running the port at 115,200 K Baud which > easily can handle the actual data through put which is about 2K bytes/S. I am > using RTS/CTS hardware flow control. The microcontroller has a 256 byte tx > FIFO buffer, the PC USART buffer is set at 15 Bytes, the serial COM port rx > buffer is set to 16Kbytes and similarly the rx readbuffer is 16KB. > > I am currently developing the application on the Windows XP platform but > would like it to run under either XP or Linux. I am wondering if the RXTX 2.1 > comm package would be a good choice to ensure compatibility between both > platforms? Does there happen to be a HowTo document on switching over from > javax.comm to RXTX 2.1? The only real difference is you have to change your imports to 'import gnu.io.*;' Note that rxtx does not set UART buffers. I've not seen that that is possible in Linux via an API. In fact buffering is not done at all in rxtx. There are BufferedFileInputStreams in java which should be able to handle that. > > I am currently using the Sun javax.comm 2.0 package and I am encountering > problems with occasional data dropouts. I wonder if anyone here has heard of > similar complaints? > > I noticed that Sun have come out with a version 3.0 communications API > package however they don't seem to offer support for Windows with it. It > seems the 2.0 javax.comm package is no longer available for download thus I > wonder what one is supposed to do to provide serial port support for the > Windows platform? I wonder if I overlooked something? > > Many thanks for reading this! Helpful suggestions would be appreciated. > > RXTX 2.1 works with windows too. We are in the early stages of evaluating Sun's recent changes but it does not look acceptable so far. Some nice ideas but some fatal problems. http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html Here are some binaries for trying rxtx 2.1 on linux and windows. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz I assume you are familiar with installing the .jar and .dll files. With rxtx, the default is to use locking files to prevent data corruption with other applications. This is different from Sun. While they can be configured out at compiletime, you will need to read the INSTALL file that comes with the source to setup lockingfiles for the binaries above: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL That needs to be moved into a wiki so people can improve it but for now you can just ask here if you have further questions. From ncssi at msn.com Mon Dec 19 20:57:24 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:57:24 -0500 Subject: [Rxtx] javax/comm/PortInUseException Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/4e66b572/attachment-0003.html From ncssi at msn.com Mon Dec 19 20:58:48 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 22:58:48 -0500 Subject: [Rxtx] javax/comm/PortInUseException and "Tiger" Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/7c8c113c/attachment-0003.html From tjarvi at qbang.org Mon Dec 19 21:04:26 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:04:26 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hello! > > I'm running windows XP PRO and Netbeans 5.0 Beta2. > > I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > > I changed all the references from "Import javax.comm to "Import gnu.io.*" > > But, when I go to run the Black Box app I get this message: > > > init: > deps-jar: > compile-single: > run-single: > java.lang.NoClassDefFoundError: javax/comm/PortInUseException > Exception in thread "main" > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > ? > > can you help me out with this? > > Thanks! > > Rick L. > > PS: I shut-down computer and made sure nothing else is using this port. I > donot even have javax.comm API installed! > > > You probably missed one: SerialPortDisplay.java:import gnu.io.PortInUseException; From ncssi at msn.com Mon Dec 19 21:34:44 2005 From: ncssi at msn.com (NCSSI organization) Date: Mon, 19 Dec 2005 23:34:44 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/0d81e48e/attachment-0003.html From tjarvi at qbang.org Mon Dec 19 21:41:07 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 21:41:07 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Mon, 19 Dec 2005, NCSSI organization wrote: > > Hi ! > > ? > > No .... I checked for this file and is there ...and all my imports are " > import gnu.io.*; " > > ________________________________________________________________________________ > From:??Trent Jarvi > Reply-To:??RXTX Developers and Users > To:??RXTX Developers and Users > Subject:??Re: [Rxtx] javax/comm/PortInUseException > Date:??Mon, 19 Dec 2005 21:04:26 -0700 (MST) > >On Mon, 19 Dec 2005, NCSSI organization wrote: > > > >> > >>Hello! > >> > >>I'm running windows XP PRO and Netbeans 5.0 Beta2. > >> > >>I installed the rxtx? file "rxtx-2.1-7pre17-i386-pc-mingw32 "? > >> > >>I changed all the references from "Import javax.comm to "Import > >>gnu.io.*" > >> > >>But, when I go to run the Black Box app I get this message: > >> > >> > >>init: > >>deps-jar: > >>compile-single: > >>run-single: > >>java.lang.NoClassDefFoundError: javax/comm/PortInUseException > >>Exception in thread "main" > >>Java Result: 1 > >>BUILD SUCCESSFUL (total time: 0 seconds) > >> > >>? > >> > >>can you help me out with this? > >> > >>Thanks! > >> > >>Rick L. > >> > >>PS: I shut-down computer and made sure nothing else is using this > >>port. I > >>donot even have javax.comm API installed! > >> > >> > >> > > > >You probably missed one: > > > >SerialPortDisplay.java:import gnu.io.PortInUseException; > > > These are your files or a modified Sun blackbox? The other frequent cause is catching the exception explicitly try { ... }catch( javax.comm.PortInUseException e ){} From ncssi at msn.com Mon Dec 19 22:20:40 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 00:20:40 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/433abde7/attachment-0003.html From tkosan at yahoo.com Mon Dec 19 22:23:41 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Mon, 19 Dec 2005 21:23:41 -0800 (PST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <200512200400.jBK40fr3005187@www.qbang.org> Message-ID: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Trent wrote: > As Sun has changed their library so that most rxtx platforms are broken, > the availability of rxtx 2.0 is only going to cause problems. > > I will be removing the links from the rxtx download page to prevent user > confusion. The files will remain in the ftp directory. If Sun fixes > their design, we could start supporting the rxtx 2.0 arrangement. > > Another option, which the license allows, is for rxtx developers to > terminate their license agreement with Sun via the EULA and move rxtx into > the javax.comm namespace. The license does not appear to be of use to > either side anymore. In fact it is hurting the adoption of Java in > general. > > Would others be interested in terminating their agreement with Sun for > Java CommAPI? Do you communicate at all with the people in Sun that are responsible for maintaining the Java Communications API? I was wondering if they were even aware of the difficulties they were causing? Ted Kosan java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Mon Dec 19 22:26:27 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:26:27 -0700 (MST) Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: References: Message-ID: On Tue, 20 Dec 2005, NCSSI organization wrote: > > I copied the Black Box. jar from a? Sun com 2.0 file i found on the > internet > > Note: changing the "catch" statment didnot work.? ( error says? "cant > find javax.comm" ) > This is probably in another file. The javax.comm.* sounds more like an import that is missed. You should not have any reference to javax.comm in any of the source files. Those come from Sun's comm.jar. From tjarvi at qbang.org Mon Dec 19 22:50:48 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Dec 2005 22:50:48 -0700 (MST) Subject: [Rxtx] Removing RXTX 2.0 From rxtx.org web pages. In-Reply-To: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> References: <20051220052341.67298.qmail@web31810.mail.mud.yahoo.com> Message-ID: On Mon, 19 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> As Sun has changed their library so that most rxtx platforms are broken, >> the availability of rxtx 2.0 is only going to cause problems. >> >> I will be removing the links from the rxtx download page to prevent user >> confusion. The files will remain in the ftp directory. If Sun fixes >> their design, we could start supporting the rxtx 2.0 arrangement. >> >> Another option, which the license allows, is for rxtx developers to >> terminate their license agreement with Sun via the EULA and move rxtx into >> the javax.comm namespace. The license does not appear to be of use to >> either side anymore. In fact it is hurting the adoption of Java in >> general. >> >> Would others be interested in terminating their agreement with Sun for >> Java CommAPI? > > Do you communicate at all with the people in Sun that are responsible for > maintaining the Java Communications API? I was wondering if they were even > aware of the difficulties they were causing? > Hi Ted I tried looking for an email contact in the CommAPI 3.0 documentation / package but did not see one. If you know of who to contact, it wouldnt hurt to let them know whats going on. -- Trent Jarvi tjarvi at qbang.org From ncssi at msn.com Mon Dec 19 23:00:12 2005 From: ncssi at msn.com (NCSSI organization) Date: Tue, 20 Dec 2005 01:00:12 -0500 Subject: [Rxtx] javax/comm/PortInUseException In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051219/9fd10332/attachment-0003.html From tma at mail.island.net Tue Dec 20 18:01:18 2005 From: tma at mail.island.net (Tom Alldread) Date: Tue, 20 Dec 2005 17:01:18 -0800 Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: References: <43A734CE.2090405@mail.island.net> Message-ID: <43A8A95E.7050800@mail.island.net> Hi Trent: Many thanks for your prompt response! I decided to give RXTX a try but have not got it to compile yet. I have run into a problem declaring the SerialOutputStream. I am pretty much a newbie with java and I guess that fact is again showing. I have changed the import statement from javax.comm to gnu.io plus placed the jar files in the sdk lib directories, dll files in the bin, ext and the win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' help window comes up with the class selection list. I have changed the class variable declorations from the javax.comm declorations of: // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; to what I think are the RXTX equivalents: private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ It seems neither of the Stream classes are accessable. As shown I also tried specifying the RXTXPort package and received a message indicating the SerialOutputStream is not accessable as it is not declared public. As a result I get an "incompatible types" error with the following constructor: outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ Is it necessary for me to re-compile the RXTXPort package with the input/output stream classes declared as public or am I using the wrong approach for RXTX code? Can you suggest an example terminal program source file that is interrupt driven for me to study? Many thanks in advance! Tom Alldread import gnu.io.*; import java.util.*; import java.awt.*; //import javax.comm.*; import java.io.*; /** * * @author tma */ public class DITTOGen extends javax.swing.JFrame implements SerialPortEventListener, Runnable { // class variables private final int BAUDRATE = 115200; private CommPortIdentifier portId; private String comPort="COM2"; // private SerialPort serialPort; // private InputStream inputStream; // private OutputStream outputStream; private RXTXPort serialPort;// this line is OK private SerialInputStream inputStream;/// CANNOT FIND SerialInputStream/ private RXTXPort.SerialOutputStream outputStream;// /SerialInputStream NOT PUBLIC/ private Enumeration portList; private int txMsgCount=0; private int numBytes; private String readBfrStr;//alternate to byte buffer // private byte[] readBuffer = new byte[16384]; //not needed snip public void sendMessage(){ byte[] byteBfr = new byte[20]; try { outputStream = serialPort.getOutputStream();/// INCOMPATIBLE TYPES ERROR/ } catch (IOException e) { PortStatusLogTxt.append("OutPut Stream Initialize error1 "+e+"\n"); } snip Trent Jarvi wrote: > On Mon, 19 Dec 2005, Tom Alldread wrote: > >> Greetings Folks: >> >> I am writing an application under java 1.5 using NetBeans 5 beta 2 >> for the IDE. My application uses a serial port to access data from a >> microcontroller based data acquisition device. I am running the port >> at 115,200 K Baud which easily can handle the actual data through put >> which is about 2K bytes/S. I am using RTS/CTS hardware flow control. >> The microcontroller has a 256 byte tx FIFO buffer, the PC USART >> buffer is set at 15 Bytes, the serial COM port rx buffer is set to >> 16Kbytes and similarly the rx readbuffer is 16KB. >> >> I am currently developing the application on the Windows XP >> platform but would like it to run under either XP or Linux. I am >> wondering if the RXTX 2.1 comm package would be a good choice to >> ensure compatibility between both platforms? Does there happen to be >> a HowTo document on switching over from javax.comm to RXTX 2.1? > > > The only real difference is you have to change your imports to 'import > gnu.io.*;' > > Note that rxtx does not set UART buffers. I've not seen that that is > possible in Linux via an API. In fact buffering is not done at all > in rxtx. There are BufferedFileInputStreams in java which should be > able to handle that. > >> >> I am currently using the Sun javax.comm 2.0 package and I am >> encountering problems with occasional data dropouts. I wonder if >> anyone here has heard of similar complaints? >> >> I noticed that Sun have come out with a version 3.0 communications >> API package however they don't seem to offer support for Windows with >> it. It seems the 2.0 javax.comm package is no longer available for >> download thus I wonder what one is supposed to do to provide serial >> port support for the Windows platform? I wonder if I overlooked >> something? >> >> Many thanks for reading this! Helpful suggestions would be >> appreciated. >> >> > > RXTX 2.1 works with windows too. We are in the early stages of > evaluating Sun's recent changes but it does not look acceptable so > far. Some nice ideas but some fatal problems. > > http://mailman.qbang.org/pipermail/rxtx/20051216/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051218/thread.html > http://mailman.qbang.org/pipermail/rxtx/20051219/thread.html > > > Here are some binaries for trying rxtx 2.1 on linux and windows. > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > I assume you are familiar with installing the .jar and .dll files. > With rxtx, the default is to use locking files to prevent data > corruption with other applications. This is different from Sun. > While they can be configured out at compiletime, you will need to read > the INSTALL file that comes with the source to setup lockingfiles for > the binaries above: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL > > That needs to be moved into a wiki so people can improve it but for > now you can just ask here if you have further questions. > > -- Very Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 2005-12-16 From tjarvi at qbang.org Tue Dec 20 18:52:03 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Dec 2005 18:52:03 -0700 (MST) Subject: [Rxtx] RXTX 2.1 For Windows XP and Linux? In-Reply-To: <43A8A95E.7050800@mail.island.net> References: <43A734CE.2090405@mail.island.net> <43A8A95E.7050800@mail.island.net> Message-ID: On Tue, 20 Dec 2005, Tom Alldread wrote: > Hi Trent: > > Many thanks for your prompt response! > > I decided to give RXTX a try but have not got it to compile yet. I have > run into a problem declaring the SerialOutputStream. I am pretty much a > newbie with java and I guess that fact is again showing. > > I have changed the import statement from javax.comm to gnu.io plus placed > the jar files in the sdk lib directories, dll files in the bin, ext and the > win32sys directories. NetBeans recognizes the presence of RXTXPort as the '.' > help window comes up with the class selection list. I have changed the class > variable declorations from the javax.comm declorations of: > > // private SerialPort serialPort; > // private InputStream inputStream; > // private OutputStream outputStream; > The rxtx 2.1 classes are the same. All rxtx 2.1 does is replace Sun's CommAPI in package gnu.io. So just change your imports and any specific reference to javax.comm with gnu.io. No class names need to be modified. A specific reference would look like javax.comm.PortInUseException and would be replaced with gnu.io.PortInUseException. It really isnt more complicated than that. It is a good idea to remove Sun's comm.jar and old copies of rxtx 2.0 if you have them. The files would be comm.jar and RXTXcomm.jar along with librxtxSerial.so. Make sure those are removed and replaced with the rxtx 2.1 files. -- Trent Jarvi tjarvi at qbang.org From tkosan at yahoo.com Wed Dec 21 15:35:14 2005 From: tkosan at yahoo.com (Ted Kosan) Date: Wed, 21 Dec 2005 14:35:14 -0800 (PST) Subject: [Rxtx] Talking with Sun In-Reply-To: <200512210104.jBL14MFk014299@www.qbang.org> Message-ID: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Trent wrote: > I tried looking for an email contact in the CommAPI 3.0 > documentation package but did not see one. If you know > of who to contact, it wouldn't hurt to let them know whats going on. I located the person inside of Sun who is responsible for their Java Communications API and he is willing to talk with the RXTX project. Since it is so close to Christmas, though, I recommend that this talk take place after the new year :-) In the mean time, I recommend that an internal RXTX discussion be started on this topic in order to determine exactly what RXTX wants to say to Sun. My initial thought is that it would be nice if the Java Communications API were placed under the Java Community Process so that groups like RXTX can officially help with it. What other topics do people think should be discussed with Sun? Ted java.net Embedded Java community co-leader tkosan at dev.java.net From tjarvi at qbang.org Wed Dec 21 19:05:13 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:05:13 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Ted Kosan wrote: > Trent wrote: > >> I tried looking for an email contact in the CommAPI 3.0 >> documentation package but did not see one. If you know >> of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > Hi Ted I only have 3 things on my mind. 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a complete package requiring no Sun packages. This is by far the most important direction rxtx will be going. 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It requrires that when someone sets the javax.comm.propoerties to another package, Sun cannot load any native libraries. It must be abstracted by design. 3) Documentation. I'd like to see the new native extensions documented enough that both of the above can work. At a very minumum, publishing the javadocs on Sun's site would be a start. It does not have to be a big drawn out thing. But right now there is nothing if one does not agree to Sun's licensing. These are all important for continued adoption of java. To be honest, I'm really leaning toward just #1. #2 is almost too much for the project. #3 is just really annoying. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Dec 21 19:08:16 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Dec 2005 19:08:16 -0700 (MST) Subject: [Rxtx] Talking with Sun In-Reply-To: References: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: On Wed, 21 Dec 2005, Trent Jarvi wrote: > On Wed, 21 Dec 2005, Ted Kosan wrote: > >> Trent wrote: >> >>> I tried looking for an email contact in the CommAPI 3.0 >>> documentation package but did not see one. If you know >>> of who to contact, it wouldn't hurt to let them know whats going on. >> >> I located the person inside of Sun who is responsible for their Java >> Communications API and he is willing to talk with the RXTX project. >> >> Since it is so close to Christmas, though, I recommend that this talk take >> place after the new year :-) >> >> In the mean time, I recommend that an internal RXTX discussion be started >> on >> this topic in order to determine exactly what RXTX wants to say to Sun. >> >> My initial thought is that it would be nice if the Java Communications API >> were >> placed under the Java Community Process so that groups like RXTX can >> officially >> help with it. >> >> What other topics do people think should be discussed with Sun? >> > > > Hi Ted > > I only have 3 things on my mind. > > 1) I'd like to put rxtx 2.1 into classpath as javax.comm. This is a > complete package requiring no Sun packages. This is by far the most > important direction rxtx will be going. > > 2) I'd like to work with Sun. RXTX 2.0 is a subset of rxtx 2.1. It > requrires that when someone sets the javax.comm.propoerties to another > package, Sun cannot load any native libraries. It must be abstracted by > design. > > 3) Documentation. I'd like to see the new native extensions documented > enough that both of the above can work. At a very minumum, publishing the > javadocs on Sun's site would be a start. It does not have to be a big drawn > out thing. But right now there is nothing if one does not agree to Sun's > licensing. > > > These are all important for continued adoption of java. To be honest, I'm > really leaning toward just #1. #2 is almost too much for the project. #3 is > just really annoying. I should be more clear. When I say classpath. I'm talking about classpath extensions at GNU. http://www.gnu.org/software/classpathx/ I'd like Sun's blessing despite what licenses may say to do that. -- Trent Jarvi tjarvi at qbang.org From edmundwatson at gmail.com Wed Dec 21 16:16:01 2005 From: edmundwatson at gmail.com (Edmund Watson) Date: Wed, 21 Dec 2005 23:16:01 +0000 Subject: [Rxtx] Talking with Sun In-Reply-To: <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> References: <200512210104.jBL14MFk014299@www.qbang.org> <20051221223514.70499.qmail@web31801.mail.mud.yahoo.com> Message-ID: <4223ad60512211516w3fdc827dw4202e3a241e8857d@mail.gmail.com> I have send it as a ticket as well just to make sure On 12/21/05, Ted Kosan wrote: > Trent wrote: > > > I tried looking for an email contact in the CommAPI 3.0 > > documentation package but did not see one. If you know > > of who to contact, it wouldn't hurt to let them know whats going on. > > I located the person inside of Sun who is responsible for their Java > Communications API and he is willing to talk with the RXTX project. > > Since it is so close to Christmas, though, I recommend that this talk take > place after the new year :-) > > In the mean time, I recommend that an internal RXTX discussion be started on > this topic in order to determine exactly what RXTX wants to say to Sun. > > My initial thought is that it would be nice if the Java Communications API were > placed under the Java Community Process so that groups like RXTX can officially > help with it. > > What other topics do people think should be discussed with Sun? > > > Ted > java.net Embedded Java community co-leader > tkosan at dev.java.net > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- A non-text attachment was scrubbed... Name: form.gif Type: image/gif Size: 178050 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20051221/f284ac0f/form-0003.gif From hammackj at gmail.com Tue Dec 27 06:24:42 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:24:42 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Hello, I have written a program and I am getting a strange error. The driver loads correctly, but when I execute my Jar file from the desktop I am unable to find any ports. I have been doing most of my testing from Netbeans where the ports are found and everything is correctly executed. Does anyone have any idea why I would get an issue like this? My jar file has the path to the driver and the driver is also installed in the jre/ ext/lib directories. OS: Windows 2000 JRE: 1.5 release 6 i think Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/24159855/attachment-0003.html From tjarvi at qbang.org Tue Dec 27 06:29:28 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 06:29:28 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> References: <22066a4b0512270524h2c428323o458b5a5e5edf976f@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I have written a program and I am getting a strange error. The driver loads > correctly, but when I execute my Jar file from the desktop I am unable to > find any ports. I have been doing most of my testing from Netbeans where the > ports are found and everything is correctly executed. Does anyone have any > idea why I would get an issue like this? My jar file has the path to the > driver and the driver is also installed in the jre/ ext/lib directories. > > OS: Windows 2000 > JRE: 1.5 release 6 i think > Hi Jacob It is also important to know the version(s) of rxtx and or CommAPI from Sun that are installed. You mention a strange error. Was there a message you saw? -- Trent Jarvi tjarvi at qbang.org From hammackj at gmail.com Tue Dec 27 06:45:04 2005 From: hammackj at gmail.com (Jacob hammack) Date: Tue, 27 Dec 2005 07:45:04 -0600 Subject: [Rxtx] Jar Execution Message-ID: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Hello, I am not certain of the comm driver version it is called comm.jar dated 11/15/1998, It has been so long since I have had an issue with the comm driver part of the program. I started to use RXTX, I am not sure if i am still using it or just the sun comm driver. Below is the code where i am getting the issue, pretty much part 1 executes when I run it outside Netbeans and part 2 will run when I am inside Netbeans. No real error messages just my debug prints. I am not exactly sure how to reply to the mailing list the correct way I am sorry if this posts another thread. public void PopulatePorts() { Application.Write("CommDriverWidget.PopulatePortCB()"); try { Enumeration pList = CommPortIdentifier.getPortIdentifiers(); // Process the list of ports, putting serial ports into ComboBox if(!pList.hasMoreElements()) //part 1 { Application.Write("DEBUG: CommDriverWidget.PopulatePortCB() - No Ports"); return; } while (pList.hasMoreElements())//part 2 { CommPortIdentifier cpi = (CommPortIdentifier) pList.nextElement(); if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) { m_PortsIDMap.put(cpi.getName(), cpi); } } } catch(Exception e) { //i use a custom exception dialog } Application.Write("CommDriverWidget.PopulatePortCB() - Complete"); } Thank you, Jacob Hammack -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20051227/56bac73e/attachment-0003.html From tjarvi at qbang.org Tue Dec 27 08:17:49 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Dec 2005 08:17:49 -0700 (MST) Subject: [Rxtx] Jar Execution In-Reply-To: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> References: <22066a4b0512270545w68e0b687pa67f59e0f0ea05b8@mail.gmail.com> Message-ID: On Tue, 27 Dec 2005, Jacob hammack wrote: > Hello, > > I am not certain of the comm driver version it is called comm.jar dated > 11/15/1998, It has been so long since I have had an issue with the comm > driver part of the program. I started to use RXTX, I am not sure if i am > still using it or just the sun comm driver. Below is the code where i am > getting the issue, pretty much part 1 executes when I run it outside > Netbeans and part 2 will run when I am inside Netbeans. No real error > messages just my debug prints. > For rxtx to help, you will have to be sure rxtx is indeed being used. You can do your enumeration in a stand alone program while printing out the actual exceptions. If you have no ports, the problem is in enumeration. Just print