From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back the message I send to it, leaving it untouched. On Windows XP this runs fine without any problem (for message size from 1000 up to 12000). On Redhat Linux 5 (kernel: 2.6.18) using the same test environment and same code I get errors when reading messages longer than ~4200 bytes (this value varies, can be up to 10000 depending how much debug print outs I have in the test code) . A message has the format: [01][xy][][00], where xy specifies the length in byte of the payload, which consists of bytes of ANY value (0-255). When reading, I ask the number of bytes available and then read this amount of bytes. I repeat this until I received all expected bytes of the message (I do know the length of the message from the value xy ,which I read first. Whenever the receipt of the message went wrong I saw, that I received 128 bytes more than expected, and in fact, when analyzing, what I actually got, I see that a sequence of 128 bytes have been received twice (it's ALWAYS 128). What could the problem be and how can I solve this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bschlining at gmail.com Thu Apr 22 10:55:21 2010 From: bschlining at gmail.com (Brian Schlining) Date: Thu, 22 Apr 2010 09:55:21 -0700 Subject: [Rxtx] CVS Stil down...any plans to fix it. Message-ID: Hi Trent et al, The CVS server for RXTX is still down (and has been for a while). Any plans to bring it back up? I know qbang is near and dear to your heart but it looks like it's time to move the RXTX source out of CVS and qbang. (and clean up the branching mess, i.e checking out the commapi-0-0-1 to get the main source code is confusing to folks and comes up again and again on the mailing list). Are there plans to move the source to something else (googlecode, bitbucket, github)? -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Fri Apr 23 08:22:04 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Fri, 23 Apr 2010 16:22:04 +0200 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Message-ID: Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid1976.log Type: application/octet-stream Size: 8219 bytes Desc: not available URL: From Wei.Shen at Honeywell.com Fri Apr 23 08:35:35 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 23 Apr 2010 10:35:35 -0400 Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CDF39A6@DE08EV1001.global.ds.honeywell.com> Hello Hans, Are you using thread pools? I had a similar problem. Quit using thread pool fixed it. Wei ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Hans Rupp Sent: April 23, 2010 8:22 AM To: rxtx at qbang.org Subject: [Rxtx] EXCEPTION_ACCESS_VIOLATION Hello list, my name is Hans and i'm new to rxtx and got a problem. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. >From time to time i get this fatal error from the jre: AbstractRxTxSerialPort.run thread gestartet! AbstractRxTxSerialPort.openSerialPort: COM9, 4800 owned: false Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verwe igert AbstractRxTxSerialPort.run() port: COM9 AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) at org.forgis.rxtx.AbstractRxTxSerialPort.openSerialPort(AbstractRxTxSer ialPort.java:241) at org.forgis.rxtx.AbstractRxTxSerialPort.run(AbstractRxTxSerialPort.jav a:368) at java.lang.Thread.run(Unknown Source) threadControler running!!! gps: false fms: true ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING ThreadControler waiting for fmsThread to die fmsThread: state: TIMED_WAITING # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10007d0d, pid=1952, tid=2036 # # JRE version: 6.0_18-b07 # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 ) # Problematic frame: ThreadControler waiting for fmsThread to die# CfmsThread: state: RUNNABLE [rxtxSerial.dll+0x7d0d] # # An error report file with more information is saved as: # C:\fmslogger0.8\hs_err_pid1952.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Other times i get only the gnu.io.PortInUseException: Unknown Application although the commportidentifier of this tells AbstractRxTxSerialPort.run() owned: false AbstractRxTxSerialPort.run() owner: null And sometimes my application is runnig as desired. I'm not able to find the cause of this behaviour by myself, has anyone of you an idea what might be going there? Thanks and Greetings Hans Rupp -------------- next part -------------- An HTML attachment was scrubbed... URL: From hansj.rupp at googlemail.com Tue Apr 27 04:31:18 2010 From: hansj.rupp at googlemail.com (Hans Rupp) Date: Tue, 27 Apr 2010 12:31:18 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Message-ID: Hello folks, It's me again. I write an application that should read data from two COM-Ports (one over USB to serial, one over RS232) and write to a common log-file. I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. This time I used code from your examples to discover available comm ports. Here's my code import java.io.*; import java.util.*; import gnu.io.*; // for rxtxSerial library public class Test { static CommPortIdentifier portId; static CommPortIdentifier saveportId; @SuppressWarnings("unchecked") static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; static String messageString = "Hello, world!"; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { getAvailableSerialPorts(); } @SuppressWarnings("unchecked") public static void getAvailableSerialPorts() { // HashSet h = new HashSet(); HashSet h = new HashSet(); while(true) { System.out.println("test"); Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("1port: "+thePort.getName()+" opened!"); System.out.println("1port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); System.out.println("1port: "+thePort.getName()+" owner: "+com.getCurrentOwner()); h.add(thePort); } catch (PortInUseException e) { System.out.println("1Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("2port: "+cp.getName()+" closed!"); cit.remove(); } thePorts = CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case CommPortIdentifier.PORT_SERIAL: try { CommPort thePort = com.open("CommUtil", 50); System.out.println("3port: "+thePort.getName()+" reopened!"); System.out.println("3port: "+thePort.getName()+" owned: "+com.isCurrentlyOwned()); h.add(thePort); } catch (PortInUseException e) { System.out.println("3Port, " + com.getName() + ", is in use."); } catch (Exception e) { System.err.println("Failed to open port " + com.getName()); e.printStackTrace(); } } } for(Iterator cit = h.iterator();cit.hasNext();) { CommPort cp = cit.next(); cp.close(); System.out.println("4port: "+cp.getName()+" closed!"); cit.remove(); } try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } And here's the output: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugri3Port, COM5, is in use. 4port: //./COM1 closed! test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1Port, COM5, is in use. 2port: //./COM1 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3Port, COM5, is in use. 4port: //./COM1 closed! This means that at the first try to open COM5 it is already marked as in Use although no other application is accesing this port and i get the error from native code. And once this happens i have no chance open the port in my application. Is there someone who can tell me whats going wrong and what i can do to avoid this? thanks hans -------------- next part -------------- An HTML attachment was scrubbed... URL: From mariusz.dec at gmail.com Tue Apr 27 08:53:23 2010 From: mariusz.dec at gmail.com (Mariusz Dec) Date: Tue, 27 Apr 2010 16:53:23 +0200 Subject: [Rxtx] Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(860): Zugriff verweigert In-Reply-To: References: Message-ID: 2010/4/27 Hans Rupp > Hello folks, > > It's me again. > I write an application that should read data from two COM-Ports (one over > USB to serial, one over RS232) and write to a common log-file. > I'm using rxtx2.1-7r2 binaries on jre 6.0_18, os is win xp. > > This time I used code from your examples to discover available comm ports. > [...] Hi, I have attached my example which works good on Linux, Win XP/Vista/7 and Macintosh. I am using RXTX2.2 pre, Java xxx18. Get 2.2 pre and try it. And now bad news: Your example works on my XP system very good as well - COM1 mainboard hardware, COM7, COM11 USB VCP dongles Maybe your VCP drivers are not enough good? I am using FTDI USB/RS hardware and firmware only. test 1port: //./COM1 opened! 1port: //./COM1 owned: true 1port: //./COM1 owner: CommUtil 1port: //./COM7 opened! 1port: //./COM7 owned: true 1port: //./COM7 owner: CommUtil 1port: //./COM11 opened! 1port: //./COM11 owned: true 1port: //./COM11 owner: CommUtil 2port: //./COM11 closed! 2port: //./COM1 closed! 2port: //./COM7 closed! 3port: //./COM1 reopened! 3port: //./COM1 owned: true 3port: //./COM7 reopened! 3port: //./COM7 owned: true 3port: //./COM11 reopened! 3port: //./COM11 owned: true 4port: //./COM11 closed! 4port: //./COM1 closed! 4port: //./COM7 closed! test In my application: Error 0x05 from native part I have only when USB is disconnected while port is open. After detecting exception when port is disonnected, I am waiting in application for this port's identifier will appears back on the list, and port goes back to normal work after next opening in the same application session. No problems. Regards Mariusz Dec -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TwoWaySerialCommMd.java Type: application/octet-stream Size: 10578 bytes Desc: not available URL: From luc.peuvrier at ses-esl.com Thu Apr 29 03:15:37 2010 From: luc.peuvrier at ses-esl.com (Luc PEUVRIER) Date: Thu, 29 Apr 2010 11:15:37 +0200 Subject: [Rxtx] system error displayed on console should be throw as IOException Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02F11CC5@lune.ses-esl.com> Having some problems on windows (part access denied) we discover that system errors are displayed on console. I think it should not be displayed on console, and should throw an IOException with message set to system error message (which one currently display on console). Best regards Luc PEUVRIER Ing?nieur d?veloppement logiciel I.T. Enginneer luc.peuvrier at ses-esl.com __________________________________ 39 rue de Montigny 95100 Argenteuil - France n T?l. : + 33 1 34 34 42 92 n Fax : + 33 1 34 34 61 62 n www.store-electronic-systems.com n www.ses-esl.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 2669 bytes Desc: image001.gif URL: From caixote.san at gmail.com Mon Apr 5 09:35:58 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 16:35:58 +0100 Subject: [Rxtx] Using rxtx-2.1-7r2 in Mac Message-ID: <4BBA035E.9020207@gmail.com> Hello! The rxtx version I'm using is 2.1-7r2 (not the pre). I went to the source at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) and found this System.loadLibrary( "rxtxSerial" ); Is this supposed to load the rxtxSerial.dll? How does it work with macs? I'm trying to use rxtx-2.1-7r2 in a Mac with an Arduino controlled through Processing. This to explain the jars attached. When I run the project attached I get: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1755) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:993) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at processing.serial.Serial.list(Serial.java:557) at testArduino.BlinkSerial.setup(BlinkSerial.java:24) at processing.core.PApplet.handleDraw(PApplet.java:1571) at processing.core.PApplet.run(PApplet.java:1496) at java.lang.Thread.run(Thread.java:613) From caixote.san at gmail.com Mon Apr 5 10:03:07 2010 From: caixote.san at gmail.com (kotoko) Date: Mon, 05 Apr 2010 17:03:07 +0100 Subject: [Rxtx] Welcome to the "Rxtx" mailing list (Digest mode) In-Reply-To: References: Message-ID: <4BBA09BB.8070303@gmail.com> Hi I can't get the source code out of the repository. It ask for the pass, what should I do? kotoko From jerrypedersen at telus.net Wed Apr 7 16:05:06 2010 From: jerrypedersen at telus.net (Jerry Pedersen) Date: Wed, 07 Apr 2010 22:05:06 +0000 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException Message-ID: <4BBD0192.6000002@telus.net> Hello I am trying to compile a small piece of code to talk to an OLED display attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. The code works fine when compiled and run with javax.comm, but I'm trying to use RXTX. I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following runtime error in NetBeans: "...Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException Exception caught: java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException java.lang.RuntimeException: Could not finish loading: java.lang.ClassNotFoundException: Could not find the class gnu/io/PortInUseException at com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." During the compile I see the following, which seems to indicate the PortInUseException class was loaded: "[loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] [loading C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] [loading C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" I searched the RXTX mail archive but found no mention of this. In other searches I found an email from 2008 that mentions this same problem with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). Any suggestions most welcome. Thanks, Jerry From bill7007 at gmail.com Thu Apr 8 09:49:50 2010 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 8 Apr 2010 11:49:50 -0400 Subject: [Rxtx] DS TINI - Could not find the class gnu/io/PortInUseException In-Reply-To: <4BBD0192.6000002@telus.net> References: <4BBD0192.6000002@telus.net> Message-ID: Jerry, Somewhere in you source code you probably have: import javax.comm.*; Try replacing it with: import gnu.io.*; For RXTX usage you want to make sure any of the comm related references are pulled from the "gnu.io" namespace instead of old Sun's "javax.comm" namespace. From your description, I am guessing you are compiling JavaKit. JavaKit.java uses that import as the first line of code. +BillJ On Wed, Apr 7, 2010 at 6:05 PM, Jerry Pedersen wrote: > Hello > > I am trying to compile a small piece of code to talk to an OLED display > attached to the serial port on a Dallas Semiconductor TINI (DS80C400) board. > The code works fine when compiled and run with javax.comm, but I'm trying > to use RXTX. > > I compile successfully under XP using Java 1.5, Netbeans 5, and RXTX 2.1.7 > ( rxtx-2.1.7-bins-r2.zip), but the build script reports the following > runtime error in NetBeans: > > "...Could not finish loading: java.lang.ClassNotFoundException: Could not > find the class gnu/io/PortInUseException > Exception caught: java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > java.lang.RuntimeException: Could not finish loading: > java.lang.ClassNotFoundException: Could not find the class > gnu/io/PortInUseException > at > com.dalsemi.system.classloader.TINIClassLoader.beginLoading(TINIClassLoader.java:142) > at com.dalsemi.TINIConvertor.go(TINIConvertor.java:761)...etc..." > > During the compile I see the following, which seems to indicate the > PortInUseException class was loaded: > > "[loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/CommPort.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/PortInUseException.class)] > [loading > C:\TINI_400\tini1.17\bin\tiniclasses.jar(java/io/IOException.class)] > [loading C:\Program > Files\Java\jdk1.5.0_11\jre\lib\ext\RXTXcomm.jar(gnu/io/UnsupportedCommOperationException.class)]" > > I searched the RXTX mail archive but found no mention of this. In other > searches I found an email from 2008 that mentions this same problem > with RXTX 2.1.7 (http://www.weathertoys.net/phpBB3/viewtopic.php?f=3&t=330). > Any suggestions most welcome. > > Thanks, > > Jerry > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pascal_kesseli at hotmail.com Sat Apr 10 03:41:17 2010 From: pascal_kesseli at hotmail.com (Pascal Kesseli) Date: Sat, 10 Apr 2010 09:41:17 +0000 Subject: [Rxtx] Cross-compiling rxtx Message-ID: Hi everyone Currently, I am trying to compile RXTX for various arm-based platforms, each using a different prefix for its build tools, e.g. xscale_be-g++ . How can rxtx be configured to compile using these cross-compilers? ./configre --target=xscale_be issues an error about the platform not being available. Thanks in advance and best regards Pascal Kesseli _________________________________________________________________ Pingu Panik! Super Spiel, neu im Messenger. http://www.messengerportal.ch/mymessenger_games.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From hairyal at gmail.com Wed Apr 14 09:19:58 2010 From: hairyal at gmail.com (Hai Ryal) Date: Wed, 14 Apr 2010 16:19:58 +0100 Subject: [Rxtx] Getting Source Message-ID: Hi there, I'm trying to get the source code for RXTX.? I followed the instructions on the website and the wiki, which suggested that the source would be available at :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not seem to work. I've also tried searching the mailing list, but that gives an "Internal Server Error". Hope I'm not being stupd and someone can help me. Best regards, Hai From jdp at syntelos.org Wed Apr 14 09:56:27 2010 From: jdp at syntelos.org (John Pritchard) Date: Wed, 14 Apr 2010 11:56:27 -0400 Subject: [Rxtx] Getting Source In-Reply-To: References: Message-ID: Hi Hai, Get the source from the download, according to recent experiences the CVS server is known to not be available.. //john On Wed, Apr 14, 2010 at 11:19 AM, Hai Ryal wrote: > Hi there, I'm trying to get the source code for RXTX. I followed the > instructions on the website and the wiki, which suggested that the > source would be available at > :pserver:anonymous at qbang.org:/var/cvs/cvsroot. However, this does not > seem to work. I've also tried searching the mailing list, but that > gives an "Internal Server Error". Hope I'm not being stupd and > someone can help me. Best regards, Hai > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Thu Apr 15 07:10:32 2010 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Thu, 15 Apr 2010 09:10:32 -0400 Subject: [Rxtx] Please issue new version of rxtx In-Reply-To: References: Message-ID: <4BC71048.30900@howardz.com> Hi, I have been using rxtx for over a year now. Still - MAC users can not use my s/w. I know the problem has been fixed, but I can not compile/make rxtx for MAC. Don't you think it's about time to issue a new version with all the binary files for Windows, Linux, and Mac ? Howard From rvraaphorst at gmail.com Thu Apr 15 09:03:05 2010 From: rvraaphorst at gmail.com (Ronald Raaphorst, van) Date: Thu, 15 Apr 2010 17:03:05 +0200 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 Message-ID: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Hi, I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: Invalid memory access of location 0x128b64938 rip=0x1281c012f I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ (Installed in /System/Library/Java/Extensions) but I keep getting the exception. I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? Best regards, Ronaldo -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.johnson at rbr-global.com Thu Apr 15 09:17:30 2010 From: greg.johnson at rbr-global.com (Greg Johnson) Date: Thu, 15 Apr 2010 11:17:30 -0400 Subject: [Rxtx] RXTX Invalid memory access when disconnecting on OSX 1.6 In-Reply-To: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> References: <99FC95BB-EA40-4756-87D4-FB5F388E1B4A@gmail.com> Message-ID: <4D9860CF-ADA7-45C7-87E4-6DA4DBA01CE7@rbr-global.com> That would be a disconnect of a USB serial dongle? RXTX doesn't handle it very well - there was some discussion of patches, but there is no release with the patches in, and the rumour is that the CVS server is now AWOL. I wonder if someone would want to fork this project and start regular releases? -- Greg Johnson, PhD Director of Engineering http://www.rbr-global.com On 2010-04-15, at 11:03 , Ronald Raaphorst, van wrote: > Hi, > > I'm trying to get RXTX working on my mac (OSX 1.6, latest update, java 1.6), but when disconnecting I get a exception: > > Invalid memory access of location 0x128b64938 rip=0x1281c012f > > I'm using the latest version (rxtx-2.2pre2-bins from rxtx.qbang.org/wiki/index.php/download) > and I've tried to use librxtxSerial.jnilib from http://iharder.sourceforge.net/current/java/ > (Installed in /System/Library/Java/Extensions) but I keep getting the exception. > > I've also seen https://www.sunspotworld.com/forums/viewtopic.php?f=25&t=2176 > > Does anybody know what's wrong, and is an update due soon, or do I have to work around the problem (i.e. connect on startup and never disconnect) ? > > Best regards, > Ronaldo > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From shenweix at hotmail.com Thu Apr 15 21:33:02 2010 From: shenweix at hotmail.com (Wei Shen) Date: Thu, 15 Apr 2010 21:33:02 -0600 Subject: [Rxtx] multithreading problem with rxtx Message-ID: Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got fault results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. Thanks in advance. Wei Shen _________________________________________________________________ Hotmail & Messenger are available on your phone. Try now. http://go.microsoft.com/?linkid=9724461 -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Thu Apr 15 22:38:57 2010 From: george.dma at gmail.com (George H) Date: Fri, 16 Apr 2010 07:38:57 +0300 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: On Fri, Apr 16, 2010 at 6:33 AM, Wei Shen wrote: > Hi experts, > > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got fault > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! > > I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java > version is 1.5_10. Thanks in advance. > > > Wei Shen I've used rxtx 2.1 and the newer version 2.2 in a multi-threading environment without problems. But I was using java 1.6. I guess you can try upgrading your vm to 1.6 and see if that makes a difference. Also trying out version 2.2-pre2 won't hurt. From msemtd at googlemail.com Fri Apr 16 07:22:34 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Fri, 16 Apr 2010 14:22:34 +0100 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: No problems with rxtx and multi-threading here (16 serial ports running simultaneously 24/7 within same JVM (1.5 and 1.6)). I'd suspect from the evidence given that your techniques are not thread-safe. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Fri Apr 16 11:30:49 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 13:30:49 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Hi experts, I am trying to communicate with multiple serial ports concurrently using multi-threading. However, the JVM crashed a few times. I even got wrong results some time. I do not know what is wrong. The program worked fine without multi-threading (communicate with serial ports sequentially).Please help! I am using rxtx 2.1-7r2 on windows XP(rxtxSerial.dll and RXTXcomm.jar). Java version is 1.5_10. The following is the error message when JVM crashes: # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] Thanks in advance. Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 13:45:17 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 15:45:17 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Fri Apr 16 16:12:04 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Fri, 16 Apr 2010 18:12:04 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: Message-ID: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> I think I am using one thread per port. However, I am not entirely sure. The following are my code I used to discover the valid serial ports. ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of John Pritchard Sent: April 16, 2010 1:45 PM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Probably want one thread on a port exclusively I'm using one thread per port, myself //john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:42:35 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:42:35 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.*newFixedThreadPool*(ports.size()); > > CompletionService taskCompletionService = *new*ExecutorCompletionService(taskExecutor); > > > > *for* (*final* CommPortIdentifier com : ports) { > > Future *validLinkFuture* = taskCompletionService > > .submit(*new* Callable() { > > > > *public* SerialPort call() *throws* Exception { > > // (send special message to the port and expect a > valid response > > getValidSerialPorts(com); > > } > > }); > > } > > > > Any comments? > > > > Wei Shen > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdp at syntelos.org Fri Apr 16 21:45:07 2010 From: jdp at syntelos.org (John Pritchard) Date: Fri, 16 Apr 2010 23:45:07 -0400 Subject: [Rxtx] windows install lib set Message-ID: Hi, I'm dev'ing on solaris for windows.. would be a nice heads-up for me to know from here if the windows install will need any mingw dlls, gcc libc? thanks, john -- http://www.google.com/profiles/john.douglas.pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From msemtd at googlemail.com Mon Apr 19 02:23:47 2010 From: msemtd at googlemail.com (Michael Erskine) Date: Mon, 19 Apr 2010 09:23:47 +0100 Subject: [Rxtx] =?utf-8?q?multithreading_problem_with_rxtx=E2=80=8F?= In-Reply-To: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. From Wei.Shen at Honeywell.com Mon Apr 19 09:06:13 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:06:13 -0400 Subject: [Rxtx] =?windows-1255?q?multithreading_problem_with_rxtx=FE?= In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B3D5@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C54@DE08EV1001.global.ds.honeywell.com> Hi Michael, The following are my code to search for the valid ports among all serial ports. public ArrayList getIXConnections() { Enumeration thePorts = CommPortIdentifier.getPortIdentifiers(); ArrayList ports = new ArrayList(); while (thePorts.hasMoreElements()) { CommPortIdentifier com = (CommPortIdentifier) thePorts .nextElement(); if (com.getPortType() == CommPortIdentifier.PORT_SERIAL) { ports.add(com); } } ArrayList links = new ArrayList(); ExecutorService taskExecutor = Executors.newFixedThreadPool(ports .size()); CompletionService taskCompletionService = new ExecutorCompletionService( taskExecutor); for (final CommPortIdentifier com : ports) { taskCompletionService.submit(new Callable() { public SerialPort call() throws Exception { SerialPort serialPort = null; try { serialPort = (SerialPort) com.open("Comm", 50); serialPort.setInputBufferSize(1200); IXCommunicationLogic ixCommunicationLogic = new IXCommunicationLogic( serialPort); ixCommunicationLogic.setTIMEOUT(200); byte[] dongleFirmwareVersion = ixCommunicationLogic .sendAndReceiveDongleMessage(--"Some special message and expects a valid response"); return serialPort; } catch (Exception e) { log.error(e); if (serialPort != null) { serialPort.close(); } return null; } } }); } for (int i = 0; i < ports.size(); i++) { try { SerialPort validLink = taskCompletionService.take().get(); if (validLink != null) { links.add(validLink); } } catch (Exception e) { log.error(e); } } return links; } public byte[]sendAndReceiveDongleMessage (byte[] payLoad) throws FMApplicationException { byte[] receivedMessage = null; for (int i = 0; i < MAX_RETRIES; i++) { try { sendMessage(destination, payLoad); receivedMessage = receiveMessage(); return receivedMessage; } catch (Exception e) { e.printStackTrace(); log.error(e); } } throw new ApplicationException(); } public void sendMessage(byte[] payLoad) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); buffer.write(START); buffer.write(version); // write the rest of the information to the buffer OutputStream outputStream = link.getOutputStream(); buffer.writeTo(outputStream); } public byte[] receiveMessage() throws Exception { link.enableReceiveTimeout(TIMEOUT); InputStream inputStream = link.getInputStream(); int read = inputStream.read(); while (read != START && inputStream.available() > 0) { read = inputStream.read(); } if (inputStream.available() == 0) { throw new Exception("time out"); } // process the message and get the payload information return payLoad; } The getIXConnections() method is very unstable. It can easily crash the JVM. When it crashes, the error message is shown as the following. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10002c2f, pid=2936, tid=3564 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x2c2f] # # An error report file with more information is saved as hs_err_pid2936.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp Any comments? Thanks. Wei Shen -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Michael Erskine Sent: April 19, 2010 2:24 AM To: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx? 2010/4/16 Shen, Wei (AB21) : > Hi experts, > I am trying to communicate with multiple serial ports concurrently using > multi-threading.? However, the JVM crashed a few times. I even got wrong > results some time. I do not know what is wrong. The program worked fine > without multi-threading (communicate with serial ports sequentially).Please > help! I'm sure we can help if you could post an example that reproduces the problem -- the smallest example that you can make will be the easiest for us to diagnose. Regards, Michael Erskine. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Wei.Shen at Honeywell.com Mon Apr 19 09:09:57 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 11:09:57 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Wei.Shen at Honeywell.com Mon Apr 19 10:19:10 2010 From: Wei.Shen at Honeywell.com (Shen, Wei (AB21)) Date: Mon, 19 Apr 2010 12:19:10 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> Message-ID: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Hi John, Your suggestion works perfectly. It seems the usage of the thread pool was causing the problem. Is it safe to say avoid using thread pool when using RXTX? Thanks. Wei Shen ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Shen, Wei (AB21) Sent: April 19, 2010 9:10 AM To: John Pritchard Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Thanks John. I will try your suggestion and let you know the results. Wei Shen ________________________________ From: jdp at syntelos.com [mailto:jdp at syntelos.com] On Behalf Of John Pritchard Sent: April 16, 2010 9:43 PM To: Shen, Wei (AB21) Cc: rxtx at qbang.org Subject: Re: [Rxtx] multithreading problem with rxtx Hi Wei, This is complicated.. should rather have a class that subclasses thread or task or runnable and takes a comm port identifier in the constructor. it gets the port in its run{} (or equiv) method in the new thread and can use any MT techniques to communicate with the state of that device. John ExecutorService taskExecutor = Executors.newFixedThreadPool(ports.size()); CompletionService taskCompletionService = new ExecutorCompletionService(taskExecutor); for (final CommPortIdentifier com : ports) { Future validLinkFuture = taskCompletionService .submit(new Callable() { public SerialPort call() throws Exception { // (send special message to the port and expect a valid response getValidSerialPorts(com); } }); } Any comments? Wei Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.dma at gmail.com Mon Apr 19 10:29:15 2010 From: george.dma at gmail.com (George H) Date: Mon, 19 Apr 2010 16:29:15 +0000 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) wrote: > Hi John, > > > > Your suggestion works perfectly. It seems the usage of the thread pool was > causing the problem. Is it safe to say avoid using thread pool when using > RXTX? Thanks. > I would say yes, especially the way you are using the executor service. It retrieves a thread from the pool, uses it and then returns to you a result, once that result is returned the thread goes back into the pool to get used by something else. I believe that's when the VM fails. You should do as John suggests and manage separate threads per serial port. From jdp at syntelos.org Mon Apr 19 19:07:51 2010 From: jdp at syntelos.org (John Pritchard) Date: Mon, 19 Apr 2010 21:07:51 -0400 Subject: [Rxtx] multithreading problem with rxtx In-Reply-To: References: <83B3B1411349194D9D05821CEF48E78CD7B5D0@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1C5C@DE08EV1001.global.ds.honeywell.com> <83B3B1411349194D9D05821CEF48E78CDC1D06@DE08EV1001.global.ds.honeywell.com> Message-ID: yes, the pool is changing the thread on the port which is causing problems. there's a couple possibilities for what's causing the problem. don't have that stuff in head these days, but i don't think it's the jvm. On Mon, Apr 19, 2010 at 12:29 PM, George H wrote: > On Mon, Apr 19, 2010 at 4:19 PM, Shen, Wei (AB21) > wrote: > > Hi John, > > > > > > > > Your suggestion works perfectly. It seems the usage of the thread pool > was > > causing the problem. Is it safe to say avoid using thread pool when using > > RXTX? Thanks. > > > > I would say yes, especially the way you are using the executor > service. It retrieves a thread from the pool, uses it and then returns > to you a result, once that result is returned the thread goes back > into the pool to get used by something else. I believe that's when the > VM fails. You should do as John suggests and manage separate threads > per serial port. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patrick.Baumann at keymile.com Thu Apr 22 06:19:26 2010 From: Patrick.Baumann at keymile.com (Baumann, Patrick) Date: Thu, 22 Apr 2010 14:19:26 +0200 Subject: [Rxtx] Receive duplicate data Message-ID: Hi I have written a program using RXTX to communicate with a network device through serial connection (USB-serial converter). For testing I use the loopback function of the network device, which just sends back